Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ログに情報追加 #90

Merged
merged 3 commits into from
Jul 29, 2024
Merged

ログに情報追加 #90

merged 3 commits into from
Jul 29, 2024

Conversation

makiuchi-d
Copy link
Member

次の情報を追加しました

  • MsgのHMAC不一致の原因
  • WebSocket切断時の受信済みMsg番号

@makiuchi-d makiuchi-d requested a review from methane July 11, 2024 04:45
dlen := len(data) - mac.Size()
if dlen < 0 {
return nil, false
return nil, xerrors.Errorf("data=%v", data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[]byte を文字列化するとき、フォーマット文字が %v だと [1 2 3 4 5] のようになるので、本当に小さい整数の配列として []byte を使っている時以外はあまり適していません。

% X にすると16進数で1バイトごとにスペースが入る (e.g. 01 02 03 04 05) ので、 data=\"% X\" くらいがいいかもしれません。

https://go.dev/play/p/g9EchZ5h3kZ

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

16進数のほうが便利ですね。直します

@makiuchi-d makiuchi-d requested a review from methane July 17, 2024 07:17
@makiuchi-d makiuchi-d merged commit 3b56972 into main Jul 29, 2024
5 checks passed
@makiuchi-d makiuchi-d deleted the modify-server-log branch July 29, 2024 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants