规避push有时json报错的问题
修复心跳包帧头错误
This commit is contained in:
parent
9d9cf6f768
commit
6367751b7a
13
server.py
13
server.py
@ -51,11 +51,15 @@ _{datetime.datetime.now()}_
|
||||
{content}""",
|
||||
"token": "tt"
|
||||
})
|
||||
res = res.json()
|
||||
if res["success"]:
|
||||
return None
|
||||
try:
|
||||
res = res.json()
|
||||
except:
|
||||
return
|
||||
else:
|
||||
return res["message"]
|
||||
if res["success"]:
|
||||
return None
|
||||
else:
|
||||
return res["message"]
|
||||
|
||||
|
||||
cache = defaultdict(list)
|
||||
@ -173,6 +177,7 @@ def tt_hh(addr, data):
|
||||
update_pairs(addr, ccid)
|
||||
# 组帧再返回
|
||||
msg = bytearray(data[:])
|
||||
msg[:5] = b"$TTMX"
|
||||
val = "%04x" % int(time.time())
|
||||
tmp=[]
|
||||
for i in range(0,len(val),2):
|
||||
|
Loading…
Reference in New Issue
Block a user