[tor-commits] [snowflake/main] Stop exporting internal code

cohosh at torproject.org cohosh at torproject.org
Thu Oct 7 15:02:01 UTC 2021


commit 5339ed2dd772e54912bd80d4ff828f56bd854272
Author: Cecylia Bocovich <cohosh at torproject.org>
Date:   Fri Oct 1 13:24:16 2021 -0400

    Stop exporting internal code
---
 server/lib/http.go      | 6 +++---
 server/lib/snowflake.go | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/server/lib/http.go b/server/lib/http.go
index 3dff45c..13855c5 100644
--- a/server/lib/http.go
+++ b/server/lib/http.go
@@ -60,14 +60,14 @@ func (conn *overrideReadConn) Read(p []byte) (int, error) {
 	return conn.Reader.Read(p)
 }
 
-type HTTPHandler struct {
+type httpHandler struct {
 	// pconn is the adapter layer between stream-oriented WebSocket
 	// connections and the packet-oriented KCP layer.
 	pconn *turbotunnel.QueuePacketConn
 	ln    *SnowflakeListener
 }
 
-func (handler *HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+func (handler *httpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 	ws, err := upgrader.Upgrade(w, r, nil)
 	if err != nil {
 		log.Println(err)
@@ -114,7 +114,7 @@ func (handler *HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 // of their stream. These clients use the WebSocket as a raw pipe, and expect
 // their session to begin and end when this single WebSocket does.
 func oneshotMode(conn net.Conn, addr net.Addr, ln *SnowflakeListener) error {
-	return ln.QueueConn(&SnowflakeClientConn{Conn: conn, address: addr})
+	return ln.queueConn(&SnowflakeClientConn{Conn: conn, address: addr})
 }
 
 // turbotunnelMode handles clients that sent turbotunnel.Token at the start of
diff --git a/server/lib/snowflake.go b/server/lib/snowflake.go
index aa1872f..6c2375f 100644
--- a/server/lib/snowflake.go
+++ b/server/lib/snowflake.go
@@ -35,7 +35,7 @@ func NewSnowflakeServer(getCertificate func(*tls.ClientHelloInfo) (*tls.Certific
 func (t *Transport) Listen(addr net.Addr) (*SnowflakeListener, error) {
 	listener := &SnowflakeListener{addr: addr, queue: make(chan net.Conn, 65534)}
 
-	handler := HTTPHandler{
+	handler := httpHandler{
 		// pconn is shared among all connections to this server. It
 		// overlays packet-based client sessions on top of ephemeral
 		// WebSocket connections.
@@ -187,7 +187,7 @@ func (l *SnowflakeListener) acceptStreams(conn *kcp.UDPSession) error {
 			}
 			return err
 		}
-		l.QueueConn(&SnowflakeClientConn{Conn: stream, address: addr})
+		l.queueConn(&SnowflakeClientConn{Conn: stream, address: addr})
 	}
 }
 
@@ -226,7 +226,7 @@ func (l *SnowflakeListener) acceptSessions(ln *kcp.Listener) error {
 	}
 }
 
-func (l *SnowflakeListener) QueueConn(conn net.Conn) error {
+func (l *SnowflakeListener) queueConn(conn net.Conn) error {
 	select {
 	case <-l.closed:
 		return fmt.Errorf("accepted connection on closed listener")





More information about the tor-commits mailing list