cvs: php4 /sapi/thttpd thttpd.c
| From: | Sascha Schumann | Date: | Sun, 05 Aug 2001 10:32:49 +0000 |
| Subject: | cvs: php4 /sapi/thttpd thttpd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6565@lists.php.net to get a copy of this message | ||
sas Sun Aug 5 06:32:49 2001 EDT
Modified files:
/php4/sapi/thttpd thttpd.c
Log:
tsrm-related cleanup
Index: php4/sapi/thttpd/thttpd.c
diff -u php4/sapi/thttpd/thttpd.c:1.49 php4/sapi/thttpd/thttpd.c:1.50
--- php4/sapi/thttpd/thttpd.c:1.49 Sun Aug 5 01:35:06 2001
+++ php4/sapi/thttpd/thttpd.c Sun Aug 5 06:32:48 2001
@@ -37,20 +37,10 @@
#ifdef ZTS
static int thttpd_globals_id;
-#define TSRMLS_D php_thttpd_globals *thttpd_context
-#define TSRMLS_DC , TSRMLS_D
-#define TSRMLS_C thttpd_context
-#define TSRMLS_CC , thttpd_context
-#define TG(v) (thttpd_context->v)
-#define TSRMLS_FETCH() TSRMLS_D = ts_resource(thttpd_globals_id)
+#define TG(v) TSRMG(thttpd_globals_id, php_thttpd_globals *, v)
#else
static php_thttpd_globals thttpd_globals;
-#define TSRMLS_D
-#define TSRMLS_DC
-#define TSRMLS_C
-#define TSRMLS_CC
#define TG(v) (thttpd_globals.v)
-#define TSRMLS_FETCH()
#endif
static int sapi_thttpd_ub_write(const char *str, uint str_length)
@@ -88,7 +78,6 @@
zend_llist_position pos;
sapi_header_struct *h;
size_t len;
- TSRMLS_FETCH();
if (!SG(sapi_headers).http_status_line) {
snprintf(buf, 1023, "HTTP/1.0 %d Something\r\n", SG(sapi_headers).http_response_code);
@@ -137,7 +126,6 @@
{
size_t read_bytes = 0, tmp;
int c;
- TSRMLS_FETCH();
/* to understand this, read cgi_interpose_input() in libhttpd.c */
c = TG(hc)->read_idx - TG(hc)->checked_idx;
@@ -164,8 +152,6 @@
static char *sapi_thttpd_read_cookies(TSRMLS_D)
{
- TSRMLS_FETCH();
-
return TG(hc)->cookie;
}
@@ -173,11 +159,10 @@
#define ADD_STRING(name) \
php_register_variable(name, buf, track_vars_array TSRMLS_CC)
-static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC TSRMLS_DC TSRMLS_DC)
+static void sapi_thttpd_register_variables(zval *track_vars_array TSRMLS_DC)
{
char buf[BUF_SIZE + 1];
char *p;
- TSRMLS_FETCH();
php_register_variable("PHP_SELF", SG(request_info).request_uri, track_vars_array
TSRMLS_CC);
php_register_variable("SERVER_SOFTWARE", SERVER_SOFTWARE, track_vars_array TSRMLS_CC);
@@ -258,10 +243,9 @@
STANDARD_SAPI_MODULE_PROPERTIES
};
-static void thttpd_module_main(TSRMLS_D TSRMLS_DC)
+static void thttpd_module_main(TSRMLS_D)
{
zend_file_handle file_handle;
- TSRMLS_FETCH();
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = SG(request_info).path_translated;
@@ -438,13 +422,12 @@
tsrm_mutex_unlock(qr_lock);
}
-static off_t thttpd_real_php_request(httpd_conn *hc TSRMLS_DC TSRMLS_DC);
+static off_t thttpd_real_php_request(httpd_conn *hc TSRMLS_DC);
static void *worker_thread(void *dummy)
{
int do_work = 50;
httpd_conn *hc;
- TSRMLS_FETCH();
while (do_work) {
hc = dequeue_request();
@@ -517,7 +500,7 @@
queue_request(hc);
#else
TSRMLS_FETCH();
- return thttpd_real_php_request(hc TSRMLS_CC TSRMLS_CC);
+ return thttpd_real_php_request(hc TSRMLS_CC);
#endif
}
@@ -558,6 +541,7 @@
thttpd_sapi_module.startup(&thttpd_sapi_module);
{
TSRMLS_FETCH();
+
SG(server_context) = (void *) 1;
}
}