tracker: Pass listen address into tracker.Server.Serve()

This commit is contained in:
Justin Li
2015-02-21 13:16:21 -05:00
parent f98c675bc7
commit 669128c83a
4 changed files with 12 additions and 12 deletions

View File

@@ -121,8 +121,8 @@ func (s *Server) connState(conn net.Conn, state http.ConnState) {
}
// Serve runs an HTTP server, blocking until the server has shut down.
func (s *Server) Serve() {
glog.V(0).Info("Starting HTTP on ", s.config.HTTPListenAddr)
func (s *Server) Serve(addr string) {
glog.V(0).Info("Starting HTTP on ", addr)
if s.config.HTTPListenLimit != 0 {
glog.V(0).Info("Limiting connections to ", s.config.HTTPListenLimit)
@@ -133,7 +133,7 @@ func (s *Server) Serve() {
ConnState: s.connState,
ListenLimit: s.config.HTTPListenLimit,
Server: &http.Server{
Addr: s.config.HTTPListenAddr,
Addr: addr,
Handler: newRouter(s),
ReadTimeout: s.config.HTTPReadTimeout.Duration,
WriteTimeout: s.config.HTTPWriteTimeout.Duration,