File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -484,6 +484,10 @@ func timeoutHandle(h http.Handler) http.HandlerFunc {
484484}
485485
486486func (app * Application ) initServer (addr string ) * http.Server {
487+ return InitHTTPServer (app , addr )
488+ }
489+
490+ func InitHTTPServer (app * Application , addr string ) * http.Server {
487491 /* db := AppContextDB(app.context)
488492 if db != nil {
489493 db.SetMaxIdleConns(app.connMax + 1)
Original file line number Diff line number Diff line change @@ -110,10 +110,9 @@ func start() {
110110 addr := net .JoinHostPort (o .Options .Address , strconv .Itoa (o .Options .Port ))
111111 log .Infof ("Start listen on %s" , addr )
112112 if o .Options .EnableSsl {
113- err := http .ListenAndServeTLS (addr ,
114- o .Options .SslCertfile ,
115- o .Options .SslKeyfile ,
116- root )
113+ srv := appsrv .InitHTTPServer (app , addr )
114+ srv .Handler = root
115+ err := srv .ListenAndServeTLS (o .Options .SslCertfile , o .Options .SslKeyfile )
117116 if err != nil && err != http .ErrServerClosed {
118117 log .Fatalf ("%v" , err )
119118 }
You can’t perform that action at this time.
0 commit comments