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

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

Issue 1697048: code review 1697048: http, crypto/tls: followup fixes from 1684051. (Closed)
Patch Set: code review 1697048: http, crypto/tls: followup fixes from 1684051. Created 13 years, 8 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
« no previous file with comments | « src/pkg/crypto/tls/tls.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // cgi support 9 // cgi support
10 // post support 10 // post support
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 func ListenAndServe(addr string, handler Handler) os.Error { 635 func ListenAndServe(addr string, handler Handler) os.Error {
636 l, e := net.Listen("tcp", addr) 636 l, e := net.Listen("tcp", addr)
637 if e != nil { 637 if e != nil {
638 return e 638 return e
639 } 639 }
640 e = Serve(l, handler) 640 e = Serve(l, handler)
641 l.Close() 641 l.Close()
642 return e 642 return e
643 } 643 }
644 644
645 // ListenAndServeTLS acts identically to ListenAndServe, expect that it 645 // ListenAndServeTLS acts identically to ListenAndServe, except that it
646 // except HTTPS connections. Additionally, files containing a certificate and 646 // expects HTTPS connections. Additionally, files containing a certificate and
647 // matching private key for the server must be provided. 647 // matching private key for the server must be provided.
648 // 648 //
649 // A trivial example server is: 649 // A trivial example server is:
650 // 650 //
651 // import ( 651 // import (
652 // "http" 652 // "http"
653 // "log" 653 // "log"
654 // ) 654 // )
655 // 655 //
656 // func handler(conn *http.Conn, req *http.Request) { 656 // func handler(conn *http.Conn, req *http.Request) {
(...skipping 26 matching lines...) Expand all
683 } 683 }
684 684
685 conn, err := net.Listen("tcp", addr) 685 conn, err := net.Listen("tcp", addr)
686 if err != nil { 686 if err != nil {
687 return err 687 return err
688 } 688 }
689 689
690 tlsListener := tls.NewListener(conn, config) 690 tlsListener := tls.NewListener(conn, config)
691 return Serve(tlsListener, handler) 691 return Serve(tlsListener, handler)
692 } 692 }
OLDNEW
« no previous file with comments | « src/pkg/crypto/tls/tls.go ('k') | no next file » | no next file with comments »

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