cvs: /php4/sapi/cgi cgi_main.c
| From: | Thies C. Arntzen | Date: | Wed, 19 Apr 2000 15:38:13 +0000 |
| Subject: | cvs: /php4/sapi/cgi cgi_main.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-13745@lists.php.net to get a copy of this message | ||
thies Wed Apr 19 08:38:13 2000 EDT
Modified files:
/php4/sapi/cgi cgi_main.c
Log:
ignore SIGPIPE in standalone-mode so that one can actually use fsockopen() *and* have the remote
side close the socket whithout PHP dying!
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.34 php4/sapi/cgi/cgi_main.c:1.35
--- php4/sapi/cgi/cgi_main.c:1.34 Sun Mar 12 09:18:21 2000
+++ php4/sapi/cgi/cgi_main.c Wed Apr 19 08:37:43 2000
@@ -61,6 +61,10 @@
#include <syslog.h>
#endif
+#if HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+
#include "zend_compile.h"
#include "zend_execute.h"
#include "zend_highlight.h"
@@ -333,6 +337,13 @@
sapi_globals_struct *sapi_globals;
#endif
+
+#if HAVE_SIGNAL_H
+ signal(SIGPIPE,SIG_IGN); /* ignore SIGPIPE in standalone mode so that sockets created via
+ fsockopen() don't kill PHP if the remote site closes it.
+ in apache|apxs mode apache does that for us!
+ thies@digicol.de 20000419 */
+#endif
#ifndef ZTS
if (setjmp(EG(bailout))!=0) {