-
Notifications
You must be signed in to change notification settings - Fork 18
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
merge with private mirror #143
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Add upgrade request/response callbacks These callbacks are invoked during the handshake just before the upgrade request is sent and just after the response is received. * Add websocket rtt example * Add docs
* Update gosec build step * IO can unset reads/writes * Close() unsets reads+writes and deregisters the IO slot * AsyncAdapter exposes its IO Slot
No need for Blocking and Nonblocking variants anymore as all reads and writes are dispatched through the underlying ByteBuffer which in turns dispatches calls to a specific Stream interface. That Stream interface is ultimately responsible for dispatching reads/writes in a blocking or non-blocking way.
The Frame is now a []byte slice and not a struct with 3 slices: header, mask, payload. SetFIN, SetOpcode etc employ the builder pattern to make a frame.
And not globally, per all streams.
Will be refered to as websocket.Stream.
Simplifies stream.WriteTo
With a ProtocolError. The close frame must be explicitly flushed by callers, for now.
The connection should fail with 1002/Protocol error if any of the RSV1/2/3 bits are set.
…e-with-private-mirror
Use the one from the slot, as we do in packet.go.
This ensures we also prevent stack overflows when two objects build up each other's stackframes. See TestDispatchLimit for such a case.
In file.go and conn.go
Instead of creating the asynchronous callback with getReadHandler we now store the async state in fileReadReactor which is allocated once. This is identical to how multicast/peer.go does async reads, so the mechanism is well-tested.
Same reasoning as the previous commit, but for writes.
…e-with-private-mirror
I probably messed up a diff somewhere. The public repo is now in sync with the private mirror.
Otherwise we will mark the connection as successful and a subsequent read/write will return EOF. In reality, the connect syscall failed. Checking the return value of Getsockoptint(... SO_ERROR) will tell us whether the connect syscall succeeded. A return value of 0 means success - anything else can be interpreted by syscall.Errno and means failure. I was mislead into thinking the returned `err` from `Getsockoptint` is the actual socket error - in reality, it's whether the `getsockopt` syscall succeeded or not. - Golang src: https://github.com/golang/go/blob/04879acdebbb08bdca00356f043d769c4b4375ce/src/syscall/syscall_unix.go#L312 - Sanity check that uninit values are set to 0: https://go.dev/play/p/vCLjDd6WwL- - syscall.Errno is safe for any input value: https://cs.opensource.google/go/go/+/refs/tags/go1.23.3:src/syscall/syscall_unix.go;l=110
…e-with-private-mirror
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.