an iterative web-server. This will be used by the IRCG extension.
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
typedef struct {
httpd_conn *hc;
int post_off;
+ void (*on_close)(int);
} php_thttpd_globals;
static php_thttpd_globals thttpd_globals;
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)
{
sapi_startup(&sapi_module);