Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(554)

Side by Side Diff: src/pkg/net/http/server.go

Issue 5449070: code review 5449070: net: shorten composite literal field values (Closed)
Patch Set: diff -r f91f50b96e10 https://go.googlecode.com/hg/ Created 12 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // HTTP server. See RFC 2616. 5 // HTTP server. See RFC 2616.
6 6
7 // TODO(rsc): 7 // TODO(rsc):
8 // logging 8 // logging
9 9
10 package http 10 package http
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 // of the server's certificate followed by the CA's certificate. 1077 // of the server's certificate followed by the CA's certificate.
1078 // 1078 //
1079 // If srv.Addr is blank, ":https" is used. 1079 // If srv.Addr is blank, ":https" is used.
1080 func (s *Server) ListenAndServeTLS(certFile, keyFile string) error { 1080 func (s *Server) ListenAndServeTLS(certFile, keyFile string) error {
1081 addr := s.Addr 1081 addr := s.Addr
1082 if addr == "" { 1082 if addr == "" {
1083 addr = ":https" 1083 addr = ":https"
1084 } 1084 }
1085 config := &tls.Config{ 1085 config := &tls.Config{
1086 Rand: rand.Reader, 1086 Rand: rand.Reader,
1087 » » NextProtos: []string{"http/1.1"}, 1087 » » NextProtos: {"http/1.1"},
gri 2011/12/02 23:06:26 I'd leave this file alone - no real win
1088 } 1088 }
1089 1089
1090 var err error 1090 var err error
1091 config.Certificates = make([]tls.Certificate, 1) 1091 config.Certificates = make([]tls.Certificate, 1)
1092 config.Certificates[0], err = tls.LoadX509KeyPair(certFile, keyFile) 1092 config.Certificates[0], err = tls.LoadX509KeyPair(certFile, keyFile)
1093 if err != nil { 1093 if err != nil {
1094 return err 1094 return err
1095 } 1095 }
1096 1096
1097 conn, err := net.Listen("tcp", addr) 1097 conn, err := net.Listen("tcp", addr)
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 func (tw *timeoutWriter) WriteHeader(code int) { 1181 func (tw *timeoutWriter) WriteHeader(code int) {
1182 tw.mu.Lock() 1182 tw.mu.Lock()
1183 if tw.timedOut || tw.wroteHeader { 1183 if tw.timedOut || tw.wroteHeader {
1184 tw.mu.Unlock() 1184 tw.mu.Unlock()
1185 return 1185 return
1186 } 1186 }
1187 tw.wroteHeader = true 1187 tw.wroteHeader = true
1188 tw.mu.Unlock() 1188 tw.mu.Unlock()
1189 tw.w.WriteHeader(code) 1189 tw.w.WriteHeader(code)
1190 } 1190 }
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b