Skip to content

Commit

Permalink
fix #2347: This mutex is not locked
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Aug 4, 2023
1 parent 3b99a82 commit 5db03c7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cmd/gocq/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,13 @@ func signSubmit(uin string, cmd string, callbackID int64, buffer []byte, t strin
signServer += "/"
}
buffStr := hex.EncodeToString(buffer)
log.Infof("submit %v: uin=%v, cmd=%v, callbackID=%v, buffer-end=%v", t, uin, cmd, callbackID,
buffStr[len(buffStr)-10:])
tail := 64
endl := "..."
if len(buffStr) < tail {
tail = len(buffStr)
endl = "."
}
log.Infof("submit %v: uin=%v, cmd=%v, callbackID=%v, buffer=%v%s", t, uin, cmd, callbackID, buffer[:tail], endl)
_, err := download.Request{
Method: http.MethodGet,
URL: signServer + "submit" + fmt.Sprintf("?uin=%v&cmd=%v&callback_id=%v&buffer=%v",
Expand All @@ -334,9 +339,7 @@ func signCallback(uin string, results []gjson.Result, t string) {
if err != nil {
log.Warnf("callback error: %v", err)
}
if len(ret) > 10 {
signSubmit(uin, cmd, callbackID, ret, t)
}
signSubmit(uin, cmd, callbackID, ret, t)
}
}

Expand Down

0 comments on commit 5db03c7

Please sign in to comment.