aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-23 20:57:53 -0500
committerAdnan Maolood <[email protected]>2021-02-23 20:57:53 -0500
commit75abb99518b68534ffc441c56077346f36fa2bd5 (patch)
tree1d4bddf8e290cbc16f460c5ac5e0fff0a5f56445
parentMove I/O utilities to io.go (diff)
downloadgo-gemini-75abb99518b68534ffc441c56077346f36fa2bd5.tar.xz
go-gemini-75abb99518b68534ffc441c56077346f36fa2bd5.zip
request: Remove TLS and Conn methods
-rw-r--r--request.go18
-rw-r--r--server.go1
2 files changed, 0 insertions, 19 deletions
diff --git a/request.go b/request.go
index f15d891..3bfa3db 100644
--- a/request.go
+++ b/request.go
@@ -4,7 +4,6 @@ import (
"bufio"
"crypto/tls"
"io"
- "net"
"net/url"
)
@@ -27,8 +26,6 @@ type Request struct {
// TLS certificate to present to the other side of the connection.
// This field is ignored by the Gemini server.
Certificate *tls.Certificate
-
- conn net.Conn
}
// NewRequest returns a new request.
@@ -92,18 +89,3 @@ func (r *Request) Write(w io.Writer) error {
}
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
-}
diff --git a/server.go b/server.go
index 961203b..21634e2 100644
--- a/server.go
+++ b/server.go
@@ -366,7 +366,6 @@ func (srv *Server) serveConn(ctx context.Context, conn net.Conn) error {
w.WriteHeader(StatusBadRequest, "Bad request")
return w.Flush()
}
- req.conn = conn
h := srv.Handler
if h == nil {