request: Remove TLS and Conn methods
This commit is contained in:
parent
e8d98ef4ec
commit
75abb99518
18
request.go
18
request.go
@ -4,7 +4,6 @@ import (
|
|||||||
"bufio"
|
"bufio"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -27,8 +26,6 @@ type Request struct {
|
|||||||
// TLS certificate to present to the other side of the connection.
|
// TLS certificate to present to the other side of the connection.
|
||||||
// This field is ignored by the Gemini server.
|
// This field is ignored by the Gemini server.
|
||||||
Certificate *tls.Certificate
|
Certificate *tls.Certificate
|
||||||
|
|
||||||
conn net.Conn
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewRequest returns a new request.
|
// NewRequest returns a new request.
|
||||||
@ -92,18 +89,3 @@ func (r *Request) Write(w io.Writer) error {
|
|||||||
}
|
}
|
||||||
return bw.Flush()
|
return bw.Flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Conn returns the network connection on which the request was received.
|
|
||||||
func (r *Request) Conn() net.Conn {
|
|
||||||
return r.conn
|
|
||||||
}
|
|
||||||
|
|
||||||
// TLS returns information about the TLS connection on which the
|
|
||||||
// request was received.
|
|
||||||
func (r *Request) TLS() *tls.ConnectionState {
|
|
||||||
if tlsConn, ok := r.conn.(*tls.Conn); ok {
|
|
||||||
state := tlsConn.ConnectionState()
|
|
||||||
return &state
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
@ -366,7 +366,6 @@ func (srv *Server) serveConn(ctx context.Context, conn net.Conn) error {
|
|||||||
w.WriteHeader(StatusBadRequest, "Bad request")
|
w.WriteHeader(StatusBadRequest, "Bad request")
|
||||||
return w.Flush()
|
return w.Flush()
|
||||||
}
|
}
|
||||||
req.conn = conn
|
|
||||||
|
|
||||||
h := srv.Handler
|
h := srv.Handler
|
||||||
if h == nil {
|
if h == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user