mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Cosmetic changes from dev-snowflake-udp-rebase-extradata.
https://gitlab.torproject.org/shelikhoo/snowflake/-/tree/dev-snowflake-udp-rebase-extradata commit 59b76dc68d2ee0383c2acd91cb0f44edc46af939
This commit is contained in:
parent
a93b4859c7
commit
ee5f815f60
4 changed files with 11 additions and 9 deletions
|
@ -55,7 +55,7 @@ const (
|
|||
// WindowSize is the number of packets in the send and receive window of a KCP connection.
|
||||
WindowSize = 65535
|
||||
// StreamSize controls the maximum amount of in flight data between a client and server.
|
||||
StreamSize = 1048576 //1MB
|
||||
StreamSize = 1048576 // 1MB
|
||||
)
|
||||
|
||||
// Transport is a structure with methods that conform to the Go PT v2.1 API
|
||||
|
@ -66,7 +66,6 @@ type Transport struct {
|
|||
|
||||
// NewSnowflakeServer returns a new server-side Transport for Snowflake.
|
||||
func NewSnowflakeServer(getCertificate func(*tls.ClientHelloInfo) (*tls.Certificate, error)) *Transport {
|
||||
|
||||
return &Transport{getCertificate: getCertificate}
|
||||
}
|
||||
|
||||
|
@ -164,7 +163,6 @@ func (t *Transport) Listen(addr net.Addr, numKCPInstances int) (*SnowflakeListen
|
|||
}
|
||||
|
||||
return listener, nil
|
||||
|
||||
}
|
||||
|
||||
type SnowflakeListener struct {
|
||||
|
@ -182,7 +180,7 @@ type SnowflakeListener struct {
|
|||
func (l *SnowflakeListener) Accept() (net.Conn, error) {
|
||||
select {
|
||||
case <-l.closed:
|
||||
//channel has been closed, no longer accepting connections
|
||||
// channel has been closed, no longer accepting connections
|
||||
return nil, io.ErrClosedPipe
|
||||
case conn := <-l.queue:
|
||||
return conn, nil
|
||||
|
@ -304,6 +302,7 @@ func (conn *SnowflakeClientConn) SetDeadline(t time.Time) error { return conn.st
|
|||
func (conn *SnowflakeClientConn) SetReadDeadline(t time.Time) error {
|
||||
return conn.stream.SetReadDeadline(t)
|
||||
}
|
||||
|
||||
func (conn *SnowflakeClientConn) SetWriteDeadline(t time.Time) error {
|
||||
return conn.stream.SetWriteDeadline(t)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue