Skip to content

Commit ca8a998

Browse files
committed
rename srv to s in comments
1 parent ad17790 commit ca8a998

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/net/http/server.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3161,11 +3161,11 @@ func AllowQuerySemicolons(h Handler) Handler {
31613161
})
31623162
}
31633163

3164-
// ListenAndServe listens on the TCP network address srv.Addr and then
3164+
// ListenAndServe listens on the TCP network address s.Addr and then
31653165
// calls [Serve] to handle requests on incoming connections.
31663166
// Accepted connections are configured to enable TCP keep-alives.
31673167
//
3168-
// If srv.Addr is blank, ":http" is used.
3168+
// If s.Addr is blank, ":http" is used.
31693169
//
31703170
// ListenAndServe always returns a non-nil error. After [Server.Shutdown] or [Server.Close],
31713171
// the returned error is [ErrServerClosed].
@@ -3187,7 +3187,7 @@ func (s *Server) ListenAndServe() error {
31873187
var testHookServerServe func(*Server, net.Listener) // used if non-nil
31883188

31893189
// shouldConfigureHTTP2ForServe reports whether Server.Serve should configure
3190-
// automatic HTTP/2. (which sets up the srv.TLSNextProto map)
3190+
// automatic HTTP/2. (which sets up the s.TLSNextProto map)
31913191
func (s *Server) shouldConfigureHTTP2ForServe() bool {
31923192
if s.TLSConfig == nil {
31933193
// Compatibility with Go 1.6:
@@ -3214,7 +3214,7 @@ var ErrServerClosed = errors.New("http: Server closed")
32143214

32153215
// Serve accepts incoming connections on the Listener l, creating a
32163216
// new service goroutine for each. The service goroutines read requests and
3217-
// then call srv.Handler to reply to them.
3217+
// then call s.Handler to reply to them.
32183218
//
32193219
// HTTP/2 support is only enabled if the Listener returns [*tls.Conn]
32203220
// connections and they were configured with "h2" in the TLS
@@ -3288,7 +3288,7 @@ func (s *Server) Serve(l net.Listener) error {
32883288

32893289
// ServeTLS accepts incoming connections on the Listener l, creating a
32903290
// new service goroutine for each. The service goroutines perform TLS
3291-
// setup and then read requests, calling srv.Handler to reply to them.
3291+
// setup and then read requests, calling s.Handler to reply to them.
32923292
//
32933293
// Files containing a certificate and matching private key for the
32943294
// server must be provided if neither the [Server]'s
@@ -3448,7 +3448,7 @@ func ListenAndServeTLS(addr, certFile, keyFile string, handler Handler) error {
34483448
return server.ListenAndServeTLS(certFile, keyFile)
34493449
}
34503450

3451-
// ListenAndServeTLS listens on the TCP network address srv.Addr and
3451+
// ListenAndServeTLS listens on the TCP network address s.Addr and
34523452
// then calls [ServeTLS] to handle requests on incoming TLS connections.
34533453
// Accepted connections are configured to enable TCP keep-alives.
34543454
//
@@ -3459,7 +3459,7 @@ func ListenAndServeTLS(addr, certFile, keyFile string, handler Handler) error {
34593459
// concatenation of the server's certificate, any intermediates, and
34603460
// the CA's certificate.
34613461
//
3462-
// If srv.Addr is blank, ":https" is used.
3462+
// If s.Addr is blank, ":https" is used.
34633463
//
34643464
// ListenAndServeTLS always returns a non-nil error. After [Server.Shutdown] or
34653465
// [Server.Close], the returned error is [ErrServerClosed].
@@ -3483,15 +3483,15 @@ func (s *Server) ListenAndServeTLS(certFile, keyFile string) error {
34833483
}
34843484

34853485
// setupHTTP2_ServeTLS conditionally configures HTTP/2 on
3486-
// srv and reports whether there was an error setting it up. If it is
3486+
// s and reports whether there was an error setting it up. If it is
34873487
// not configured for policy reasons, nil is returned.
34883488
func (s *Server) setupHTTP2_ServeTLS() error {
34893489
s.nextProtoOnce.Do(s.onceSetNextProtoDefaults)
34903490
return s.nextProtoErr
34913491
}
34923492

34933493
// setupHTTP2_Serve is called from (*Server).Serve and conditionally
3494-
// configures HTTP/2 on srv using a more conservative policy than
3494+
// configures HTTP/2 on s using a more conservative policy than
34953495
// setupHTTP2_ServeTLS because Serve is called after tls.Listen,
34963496
// and may be called concurrently. See shouldConfigureHTTP2ForServe.
34973497
//
@@ -3512,8 +3512,8 @@ func (s *Server) onceSetNextProtoDefaults_Serve() {
35123512
var http2server = godebug.New("http2server")
35133513

35143514
// onceSetNextProtoDefaults configures HTTP/2, if the user hasn't
3515-
// configured otherwise. (by setting srv.TLSNextProto non-nil)
3516-
// It must only be called via srv.nextProtoOnce (use srv.setupHTTP2_*).
3515+
// configured otherwise. (by setting s.TLSNextProto non-nil)
3516+
// It must only be called via s.nextProtoOnce (use s.setupHTTP2_*).
35173517
func (s *Server) onceSetNextProtoDefaults() {
35183518
if omitBundledHTTP2 {
35193519
return

0 commit comments

Comments
 (0)