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

Ergo receives DIST packet along with the HANDSHAKE final packet. #117

Closed
halturin opened this issue Nov 21, 2022 Discussed in #115 · 1 comment
Closed

Ergo receives DIST packet along with the HANDSHAKE final packet. #117

halturin opened this issue Nov 21, 2022 Discussed in #115 · 1 comment
Assignees
Labels
Milestone

Comments

@halturin
Copy link
Collaborator

Discussed in #115

Originally posted by xiaodoudou12 November 18, 2022
my OTP version is Erlang/OTP 24 [erts-12.1.5] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit].
golang version is go1.18.ergo version is v1.999.211.
https://github.com/ergo-services/ergo/blob/v1.999.211/proto/dist/handshake.go:247

			case 'a':
				// 'a' + 16 (digest)
				if len(buffer) != 17 {
					return details, fmt.Errorf("malformed handshake ('a' length of digest)")
				}

				// 'a' + 16 (digest)
				digest := genDigest(dh.challenge, cookie)
				if bytes.Compare(buffer[1:17], digest) != 0 {
					return details, fmt.Errorf("malformed handshake ('a' digest)")
				}

				// handshaked
				return details, nil

sometime len(buffer) will more than 17
when like this, first receive 3 byte,then 45 byte,then 17 bytes, it work ok.
img_v2_044d6763-9d91-4ac6-ae8c-97e1e04083fg
but like this,first recevie 3 byte, then 45 byte, then 122 bytes, it not work.
img_v2_57cb63cb-3593-4908-87ff-4f388e172fbg
maybe handshake should think about TCP Stick Package.
maybe handshake should only need 17 bytes, the last bytes need take to distProto connection to read

@halturin halturin added the bug label Nov 21, 2022
@halturin halturin self-assigned this Nov 21, 2022
@halturin halturin added this to the 2.2.1 milestone Nov 21, 2022
@halturin
Copy link
Collaborator Author

halturin commented Feb 1, 2023

fix released in v2.2.1

@halturin halturin closed this as completed Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant