[PHP4BETA] CVS update: php4/php4isapi
| From: | zeev | Date: | Tue, 25 May 1999 19:09:20 +0000 |
| Subject: | [PHP4BETA] CVS update: php4/php4isapi | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1035@lists.php.net to get a copy of this message | ||
Date: Tuesday May 25, 1999 @ 15:09
Author: zeev
Update of /repository/php4/php4isapi
In directory php:/tmp/cvs-serv7559
Modified Files:
php4isapi.c
Log Message:
Load all ISAPI request headers as variables
Index: php4/php4isapi/php4isapi.c
diff -u php4/php4isapi/php4isapi.c:1.18 php4/php4isapi/php4isapi.c:1.19
--- php4/php4isapi/php4isapi.c:1.18 Fri May 21 19:25:46 1999
+++ php4/php4isapi/php4isapi.c Tue May 25 15:09:20 1999
@@ -308,6 +308,15 @@
SG(request_info).request_uri = lpECB->lpszPathInfo;
SG(request_info).content_type = lpECB->lpszContentType;
SG(request_info).content_length = lpECB->cbTotalBytes;
+ {
+ char *path_end = strrchr(SG(request_info).path_translated, '\\');
+
+ if (path_end) {
+ *path_end = 0;
+ chdir(SG(request_info).path_translated);
+ *path_end = '\\';
+ }
+ }
}
@@ -319,6 +328,43 @@
}
+static void hash_isapi_variables(ELS_D SLS_DC)
+{
+ char variable_buf[ISAPI_SERVER_VAR_BUF_SIZE];
+ DWORD variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
+ char *variable;
+ LPEXTENSION_CONTROL_BLOCK lpECB;
+
+ lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context);
+
+ if (!lpECB->GetServerVariable(lpECB->ConnID, "ALL_HTTP", variable_buf,
&variable_len)) {
+ return;
+ }
+ variable = strtok(variable_buf, "\r\n");
+ while (variable) {
+ char *colon = strchr(variable, ':');
+
+ if (colon) {
+ char *value = colon+1;
+ zval *entry = (zval *) emalloc(sizeof(zval));
+
+ while (*value==' ') {
+ value++;
+ }
+ *colon = 0;
+ entry->refcount=1;
+ entry->is_ref=0;
+ entry->value.str.len = strlen(value);
+ entry->value.str.val = estrndup(value, entry->value.str.len);
+ entry->type = IS_STRING;
+ zend_hash_add(&EG(symbol_table), variable, strlen(variable)+1, &entry, sizeof(zval *),
NULL);
+ *colon = ':';
+ }
+ variable = strtok(NULL, "\r\n");
+ }
+}
+
+
DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
{
zend_file_handle file_handle;
@@ -334,6 +380,7 @@
file_handle.type = ZEND_HANDLE_FILENAME;
php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC);
+ hash_isapi_variables(ELS_C SLS_CC);
php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
if (SG(request_info).cookie_data) {
efree(SG(request_info).cookie_data);
--
PHP 4 Beta