]> arthur.barton.de Git - netatalk.git/commitdiff
Remove sleep state flags when entering disconnected state.
authorFrank Lahm <franklahm@googlemail.com>
Fri, 12 Aug 2011 09:02:06 +0000 (11:02 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Fri, 12 Aug 2011 09:02:06 +0000 (11:02 +0200)
libatalk/dsi/dsi_stream.c

index 5630f07dddfe806b2b12296720552047200cdbd4..b7f1bb459ae6e89281001b92f6f2274f24149fb7 100644 (file)
@@ -236,7 +236,7 @@ static void unblock_sig(DSI *dsi)
  * Communication error with the client, enter disconnected state
  *
  * 1. close the socket
- * 2. set the DSI_DISCONNECTED flag
+ * 2. set the DSI_DISCONNECTED flag, remove possible sleep flags
  *
  * @returns  0 if successfully entered disconnected state
  *          -1 if ppid is 1 which means afpd master died
@@ -246,7 +246,8 @@ int dsi_disconnect(DSI *dsi)
 {
     LOG(log_note, logtype_dsi, "dsi_disconnect: entering disconnected state");
     dsi->proto_close(dsi);          /* 1 */
-    dsi->flags |= DSI_DISCONNECTED; /* 2 */
+    dsi->flags &= ~(DSI_SLEEPING | DSI_EXTSLEEP); /* 2 */
+    dsi->flags |= DSI_DISCONNECTED;
     if (geteuid() == 0)
         return -1;
     return 0;