]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/dsi/dsi_close.c
Merge master
[netatalk.git] / libatalk / dsi / dsi_close.c
index 23c9cf46ce9898faf04b5b0a3dd19fe891d300b3..80bee3fe702a79cfbd18bd7a7ac4bd8539295aaf 100644 (file)
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <arpa/inet.h>
+
 #include <atalk/dsi.h>
-#include <netatalk/endian.h>
 
 void dsi_close(DSI *dsi)
 {
   /* server generated. need to set all the fields. */
-  if (!dsi->asleep) {
+  if (!(dsi->flags & DSI_SLEEPING) && !(dsi->flags & DSI_DISCONNECTED)) {
       dsi->header.dsi_flags = DSIFL_REQUEST;
       dsi->header.dsi_command = DSIFUNC_CLOSE;
       dsi->header.dsi_requestID = htons(dsi_serverID(dsi));