Services no longer print out errors when they shut down
This commit is contained in:
@@ -19,11 +19,13 @@ type HTTP struct {
|
||||
Handler http.Handler
|
||||
|
||||
conn *Conn
|
||||
running bool
|
||||
requests requestManager
|
||||
}
|
||||
|
||||
// Close closes the mount abruptly, interrupting any active connections.
|
||||
func (htmount *HTTP) Close () error {
|
||||
htmount.running = false
|
||||
return htmount.conn.Close()
|
||||
}
|
||||
|
||||
@@ -44,12 +46,19 @@ func (htmount *HTTP) Run (service ServiceInfo) (err error) {
|
||||
}
|
||||
htmount.conn, err = Dial(htmount.MountInfo, service)
|
||||
if err != nil { return }
|
||||
|
||||
|
||||
htmount.running = true
|
||||
htmount.requests.init()
|
||||
|
||||
for {
|
||||
message, err := htmount.conn.Receive()
|
||||
if err != nil { return err }
|
||||
if err != nil {
|
||||
if htmount.running {
|
||||
return err
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
switch message.(type) {
|
||||
case protocol.MessageHTTPRequest:
|
||||
|
||||
Reference in New Issue
Block a user