]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/afp_dsi.c
Merge branch 'develop' of netafp.com:git/netatalk into develop
[netatalk.git] / etc / afpd / afp_dsi.c
index fd38fa853db2523d355d57e64cf35fbdf1261bde..f1e371676eac9d1213dbc7b667e6cc8c35cd9a9c 100644 (file)
@@ -24,6 +24,7 @@
 #include <sys/stat.h>
 #endif /* HAVE_SYS_STAT_H */
 #include <netinet/in.h>
+#include <netinet/tcp.h>
 #include <arpa/inet.h>
 #include <setjmp.h>
 #include <time.h>
 #include "fork.h"
 #include "dircache.h"
 
+#ifndef SOL_TCP
+#define SOL_TCP IPPROTO_TCP
+#endif
+
 /* 
  * We generally pass this from afp_over_dsi to all afp_* funcs, so it should already be
  * available everywhere. Unfortunately some funcs (eg acltoownermode) need acces to it
@@ -87,7 +92,7 @@ static void afp_dsi_close(AFPObj *obj)
         }
     }
 
-    close_all_vol();
+    close_all_vol(obj);
     if (obj->logout)
         (*obj->logout)();
 
@@ -472,6 +477,10 @@ void afp_over_dsi(AFPObj *obj)
         }
     }
 
+    /* set TCP_NODELAY */
+    int flag = 1;
+    setsockopt(dsi->socket, SOL_TCP, TCP_NODELAY, &flag, sizeof(flag));
+
     /* get stuck here until the end */
     while (1) {
         if (sigsetjmp(recon_jmp, 1) != 0)
@@ -529,7 +538,7 @@ void afp_over_dsi(AFPObj *obj)
 
         if (reload_request) {
             reload_request = 0;
-            load_volumes(AFPobj, of_closevol);
+            load_volumes(AFPobj, closevol);
         }
 
         /* The first SIGINT enables debugging, the next restores the config */