cvs: php4 /sapi/thttpd php_thttpd.h thttpd.c
| From: | Sascha Schumann | Date: | Mon, 13 Nov 2000 13:23:56 +0000 |
| Subject: | cvs: php4 /sapi/thttpd php_thttpd.h thttpd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2571@lists.php.net to get a copy of this message | ||
sas Mon Nov 13 05:23:56 2000 EDT
Modified files:
/php4/sapi/thttpd php_thttpd.h thttpd.c
Log:
Add thttpd-dependent interface for maintaining persistent connections on
an iterative web-server. This will be used by the IRCG extension.
Index: php4/sapi/thttpd/php_thttpd.h
diff -u php4/sapi/thttpd/php_thttpd.h:1.4 php4/sapi/thttpd/php_thttpd.h:1.5
--- php4/sapi/thttpd/php_thttpd.h:1.4 Thu May 18 08:34:45 2000
+++ php4/sapi/thttpd/php_thttpd.h Mon Nov 13 05:23:56 2000
@@ -27,4 +27,9 @@
void thttpd_php_init(void);
off_t thttpd_php_request(httpd_conn *hc);
+void thttpd_register_on_close(void (*)(int));
+void thttpd_closed_conn(int fd);
+int thttpd_get_fd(void);
+void thttpd_set_dont_close(void);
+
#endif
Index: php4/sapi/thttpd/thttpd.c
diff -u php4/sapi/thttpd/thttpd.c:1.28 php4/sapi/thttpd/thttpd.c:1.29
--- php4/sapi/thttpd/thttpd.c:1.28 Sun Nov 12 13:10:09 2000
+++ php4/sapi/thttpd/thttpd.c Mon Nov 13 05:23:56 2000
@@ -27,6 +27,7 @@
typedef struct {
httpd_conn *hc;
int post_off;
+ void (*on_close)(int);
} php_thttpd_globals;
static php_thttpd_globals thttpd_globals;
@@ -281,6 +282,26 @@
thttpd_request_dtor(TLS_C SLS_CC);
return 0;
+}
+
+void thttpd_register_on_close(void (*arg)(int))
+{
+ TG(on_close) = arg;
+}
+
+void thttpd_closed_conn(int fd)
+{
+ if (TG(on_close)) TG(on_close)(fd);
+}
+
+int thttpd_get_fd(void)
+{
+ return TG(hc)->conn_fd;
+}
+
+void thttpd_set_dont_close(void)
+{
+ TG(hc)->file_address = (char *) 1;
}
void thttpd_php_init(void)