]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/afp_dsi.c
Fix regression introduced by previous IPC fds fix
[netatalk.git] / etc / afpd / afp_dsi.c
index 3105db63efb4fde7831736e11204b83646b8fa48..bf454e15e8b16cbbd4b377a6b19033afd0ca0760 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 "uid.h"
 #endif /* FORCE_UIDGID */
 
+#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
@@ -384,7 +389,6 @@ void afp_over_dsi(AFPObj *obj)
     struct sigaction action;
 
     AFPobj = obj;
-    dsi->AFPobj = obj;
     obj->exit = afp_dsi_die;
     obj->reply = (int (*)()) dsi_cmdreply;
     obj->attention = (int (*)(void *, AFPUserBytes)) dsi_attention;
@@ -476,6 +480,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)