Close writing end of socket for ${readsocket before reading.
[exim.git] / src / src / expand.c
index 665d3d8f978ad40638a870749e2fb6c3d231438c..4943bcb5c1f24bc58054d099df40fb29763fdc35 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/expand.c,v 1.66 2006/10/30 14:59:15 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.67 2006/10/31 11:14:18 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -3833,6 +3833,14 @@ while (*s != 0)
             }
           }
 
+        /* Shut down the sending side of the socket. This helps some servers to
+        recognise that it is their turn to do some work. Just in case some
+        system doesn't have this function, make it conditional. */
+
+        #ifdef SHUT_WR
+        shutdown(fd, SHUT_WR);
+        #endif
+
         /* Now we need to read from the socket, under a timeout. The function
         that reads a file can be used. */