mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 14:11:23 -04:00
refactor message boundary constrains
This commit is contained in:
parent
33b3891648
commit
1ba58c864d
6 changed files with 10 additions and 27 deletions
|
@ -115,7 +115,7 @@ func (handler *httpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}
|
||||
|
||||
func (handler *httpHandler) turboTunnelUDPLikeMode(conn net.Conn, addr net.Addr, protocol string) error {
|
||||
func (handler *httpHandler) turboTunnelUDPLikeMode(conn *websocketconn.Conn, addr net.Addr, protocol string) error {
|
||||
// Read the ClientID from the WebRTC data channel protocol string. Every
|
||||
// packet received on this WebSocket connection pertains to the same
|
||||
// ClientID.
|
||||
|
@ -143,8 +143,7 @@ func (handler *httpHandler) turboTunnelUDPLikeMode(conn net.Conn, addr net.Addr,
|
|||
wg.Add(2)
|
||||
done := make(chan struct{})
|
||||
|
||||
connPaddable := packetpadding.NewPaddableConnection(
|
||||
packetpadding.ConfirmsReadWriteCloserPreservesMessageBoundary(conn), packetpadding.New())
|
||||
connPaddable := packetpadding.NewPaddableConnection(conn, packetpadding.New())
|
||||
|
||||
// The remainder of the WebSocket stream consists of packets, one packet
|
||||
// per WebSocket message. We read them one by one and feed them into the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue