mirror of
https://github.com/rclone/rclone.git
synced 2025-08-23 11:32:03 +02:00
httplib: add Close() method to shut the server down and use it in tests
This commit is contained in:
@@ -183,7 +183,15 @@ func (s *Server) Serve() {
|
||||
} else {
|
||||
err = s.httpServer.ListenAndServe()
|
||||
}
|
||||
log.Fatalf("Fatal error while serving HTTP: %v", err)
|
||||
log.Printf("Error while serving HTTP: %v", err)
|
||||
}
|
||||
|
||||
// Close shuts the running server down
|
||||
func (s *Server) Close() {
|
||||
err := closeServer(s.httpServer)
|
||||
if err != nil {
|
||||
log.Printf("Error on closing HTTP server: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// URL returns the serving address of this server
|
||||
|
Reference in New Issue
Block a user