cvs: /php4/sapi/roxen roxen.c
| From: | David Hedbor | Date: | Wed, 22 Dec 1999 01:01:02 +0000 |
| Subject: | cvs: /php4/sapi/roxen roxen.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-8360@lists.php.net to get a copy of this message | ||
neotron Tue Dec 21 20:01:02 1999 EDT
Modified files:
/php4/sapi/roxen roxen.c
Log:
Some fixes in thread safe (ie ZTS) mode - now it actually seems to
work perfectly. Also fixed a couple of typos.
Index: php4/sapi/roxen/roxen.c
diff -u php4/sapi/roxen/roxen.c:1.7 php4/sapi/roxen/roxen.c:1.8
--- php4/sapi/roxen/roxen.c:1.7 Mon Dec 20 18:09:52 1999
+++ php4/sapi/roxen/roxen.c Tue Dec 21 20:00:30 1999
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: roxen.c,v 1.7 1999/12/20 23:09:52 sas Exp $ */
+/* $Id: roxen.c,v 1.8 1999/12/22 01:00:30 neotron Exp $ */
#include "php.h"
#ifdef HAVE_ROXEN
@@ -80,7 +80,7 @@
/* Per thread storage area id... */
static int roxen_globals_id;
-# define GET_THIS() php_roxen_request *_request = ts_resource(roxen_globals_id);
+# define GET_THIS() php_roxen_request *_request = ts_resource(roxen_globals_id)
# define THIS _request
#else
static php_roxen_request *current_request = NULL;
@@ -266,6 +266,12 @@
static int
php_roxen_sapi_ub_write(const char *str, uint str_length)
{
+#ifdef ZTS
+ PLS_FETCH();
+#endif
+#ifdef ROXEN_USE_ZTS
+ GET_THIS();
+#endif
int sent_bytes = 0, fd = MY_FD;
if(fd)
{
@@ -367,6 +373,9 @@
static int
php_roxen_low_send_headers(sapi_headers_struct *sapi_headers SLS_DC)
{
+#ifdef ZTS
+ PLS_FETCH();
+#endif
struct pike_string *ind;
struct svalue *s_headermap;
#ifdef ROXEN_USE_ZTS
@@ -412,8 +421,12 @@
#ifdef ROXEN_USE_ZTS
GET_THIS();
#endif
- fprintf(stderr, "read post (%d bytes max)\n", count_bytes);
+#ifdef ZTS
+ PLS_FETCH();
+#endif
+ fprintf(stderr, "read post (%d bytes max)\n", count_bytes);
+
if(!MY_FD_OBJ->prog) {
PG(connection_status) = PHP_CONNECTION_ABORTED;
zend_bailout();
@@ -422,7 +435,7 @@
push_int(count_bytes);
safe_apply(MY_FD_OBJ, "read_post", 1);
- if(sp[-1].type == T_STRING) {
+ if(sp[-1].type == PIKE_T_STRING) {
MEMCPY(buf, sp[-1].u.string->str, total_read = sp[-1].u.string->len);
buf[total_read] = '\0';
} else
@@ -454,11 +467,10 @@
static void php_info_roxen(ZEND_MODULE_INFO_FUNC_ARGS)
{
-#if 0
- char buf[512];
+ // char buf[512];
PUTS("<table border=5 width=600>\n");
- php_info_print_table_row(2, "SAPI module version", "$Id: roxen.c,v 1.7 1999/12/20
23:09:52 sas Exp $");
+ php_info_print_table_row(2, "SAPI module version", "$Id: roxen.c,v 1.8 1999/12/22
01:00:30 neotron Exp $");
/* php_info_print_table_row(2, "Build date", Ns_InfoBuildDate());
php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile());
php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog());
@@ -476,7 +488,6 @@
php_info_print_table_row(2, "Server uptime", buf);
*/
PUTS("</table>");
-#endif
}
static zend_module_entry php_roxen_module = {
@@ -568,7 +579,7 @@
pval->type = IS_STRING;
pval->value.str.len = val->u.string->len;
pval->value.str.val = estrndup(val->u.string->str, pval->value.str.len);
- /* fprintf(stderr, "Header: %s(%d)=%s\n", buf, buf_len, val->u.string->str);*/
+ fprintf(stderr, "Header: %s(%d)=%s\n", buf, buf_len, val->u.string->str);
zend_hash_update(&EG(symbol_table), buf, buf_len + 1, &pval, sizeof(zval *), NULL);
}