Blame zarafa-7.0.4-fd_setsize.patch

d4b9b96
Patch by Robert Scheck <robert@fedoraproject.org> for Zarafa >= 7.0.4, which works around
d4b9b96
the issue that Zarafa is using up to 8192 open file descriptors, while the system glibc is
d4b9b96
allowing at maximum 1024. Of course glibc supports more open file descriptors, however the
d4b9b96
usage seems to be non-POSIX conform and non-portable. Finally a check was implemented into
d4b9b96
glibc by upstream developers to catch such strange usage cases. That check causes Zarafa
d4b9b96
to fail with a segmentation fault when built with -D_FORTIFY_SOURCE=2 and glibc-2.14.90-8
d4b9b96
or newer (actually Fedora 16 with updates and newer).
d4b9b96
d4b9b96
This patch is a workaround until gSOAP parts are updated/changed/rewritten to use poll(2)
d4b9b96
instead of select(2). Lowering FD_SETSIZE was suggested by Milo Oostergo from Zarafa B.V.
d4b9b96
d4b9b96
--- zarafa-7.0.4/provider/soap/soapdefs.h		2011-12-22 01:02:31.000000000 +0100
d4b9b96
+++ zarafa-7.0.4/provider/soap/soapdefs.h.fd_setsize	2012-01-12 22:36:40.000000000 +0100
d4b9b96
@@ -8,6 +8,6 @@
d4b9b96
 
d4b9b96
 #include <bits/types.h>
d4b9b96
 #undef __FD_SETSIZE
d4b9b96
-#define __FD_SETSIZE 8192
d4b9b96
+#define __FD_SETSIZE 1024
d4b9b96
 
d4b9b96
 #endif // ndef SOAPDEFS_H_
d4b9b96
--- zarafa-7.0.4/common/platform.h			2011-12-22 01:02:34.000000000 +0100
d4b9b96
+++ zarafa-7.0.4/common/platform.h.fd_setsize		2012-01-12 22:37:03.000000000 +0100
d4b9b96
@@ -52,10 +52,10 @@
d4b9b96
 
d4b9b96
 
d4b9b96
   // We have to include this now in case select.h is included too soon.
d4b9b96
-  // Increase our maximum amount of file descriptors to 8192
d4b9b96
+  // Increase our maximum amount of file descriptors to 1024
d4b9b96
   #include <bits/types.h>
d4b9b96
   #undef __FD_SETSIZE
d4b9b96
-  #define __FD_SETSIZE 8192
d4b9b96
+  #define __FD_SETSIZE 1024
d4b9b96
 
d4b9b96
   // Log the pthreads locks
d4b9b96
   #define DEBUG_PTHREADS 0