Date: 05/31/98
- Next message: shane: "[PHP-DEV] CVS update: php31/main"
- Previous message: shane: "[PHP-DEV] CVS update: php31/main"
- Next in thread: shane: "[PHP-DEV] CVS update: php31/sapi"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sunday May 31, 1998 @ 16:23
Author: shane
Update of /repository/php31/sapi
In directory asf:/tmp/cvs-serv28442/sapi
Modified Files:
cgi_sapi.c
Log Message:
Fix sapi cgi. fixes to mutex and critical sections code.
Index: php31/sapi/cgi_sapi.c
diff -c php31/sapi/cgi_sapi.c:1.5 php31/sapi/cgi_sapi.c:1.6
*** php31/sapi/cgi_sapi.c:1.5 Sun May 31 15:44:05 1998
--- php31/sapi/cgi_sapi.c Sun May 31 16:23:32 1998
***************
*** 12,17 ****
--- 12,23 ----
#include "sapi.h"
#include <windows.h>
#include <winsock.h>
+ #include "tls.h"
+ #include "snprintf.h"
+
+ #define SAPI_FUNC_VARS \
+ php3_globals_struct *php3_globals=(php3_globals_struct *)php3_globals_var;\
+ struct sapi_request_info *sapi_info=(struct sapi_request_info *)php3_globals->sapi_rqst
/* for cgi this can be global */
struct sapi_request_info sapi_info;
***************
*** 54,67 ****
fprintf(stderr,message);
}
! void sapi_block(void *php3_globals_var){}
! void sapi_unblock(void *php3_globals_var){}
! void sapi_print_info(void *php3_globals_var){}
/******************************************************************************
/* code from main.c in hash_environment()
/*****************************************************************************/
void sapi_hash_server_env(void *php3_globals_var){
/* Build the special-case PHP_SELF variable for the CGI version */
char *sn, *pi;
int l = 0;
--- 60,98 ----
fprintf(stderr,message);
}
! void sapi_print_info(void *php3_globals_var){
! }
! void sapi_block(void *php3_globals_var){
! }
! void sapi_unblock(void *php3_globals_var){
! }
! void sapi_reqister_cleanup(void *php3_globals_var, void *arg1, void *arg2, void *arg3){
! }
! void sapi_request_shutdown(void *php3_globals_var){
! }
!
! #if defined(CRASH_DETECTION)
! /******************************************************************************
! /* crash detection logging
! /*****************************************************************************/
! void sapi_debug_log(void *php3_globals_var, char *message){
! SAPI_FUNC_VARS;
! char log_message[256];
!
! #if MSVC5
! snprintf(log_message,256,"pid=%d:%s script='%s'",message,sapi_info->filename,GetCurrentThreadId());
! OutputDebugString(log_message);
! #endif
! }
! #endif
/******************************************************************************
/* code from main.c in hash_environment()
/*****************************************************************************/
void sapi_hash_server_env(void *php3_globals_var){
+ SAPI_FUNC_VARS;
+ pval tmp;
+
/* Build the special-case PHP_SELF variable for the CGI version */
char *sn, *pi;
int l = 0;
***************
*** 79,85 ****
tmp.value.str.val = emalloc(l + 1);
tmp.value.str.len = _php3_sprintf(tmp.value.str.val, "%s%s", (sn ? sn : ""), (pi ? pi : "")); /* SAFE */
tmp.type = IS_STRING;
! hash_update(&GLOBAL(symbol_table), "PHP_SELF", sizeof("PHP_SELF"), (void *) & tmp, sizeof(pval), NULL);
}
void sapi_init(void)
--- 110,116 ----
tmp.value.str.val = emalloc(l + 1);
tmp.value.str.len = _php3_sprintf(tmp.value.str.val, "%s%s", (sn ? sn : ""), (pi ? pi : "")); /* SAFE */
tmp.type = IS_STRING;
! hash_update(&php3_globals->symbol_table, "PHP_SELF", sizeof("PHP_SELF"), (void *) & tmp, sizeof(pval), NULL);
}
void sapi_init(void)
***************
*** 109,114 ****
--- 140,148 ----
sapi_info.content_type = getenv("CONTENT_TYPE");
sapi_info.cookies = getenv("HTTP_COOKIE");
sapi_info.script_filename = getenv("SCRIPT_FILENAME");
+
+ sapi_info.aborted=0;
+
sapi_info.puts=sapi_puts;
sapi_info.putc=sapi_putc;
sapi_info.getenv=sapi_getenv;
***************
*** 117,126 ****
sapi_info.insert_header=sapi_insert_header;
sapi_info.send_header=sapi_send_header;
sapi_info.readclient=sapi_readclient;
! sapi_info.block=sapi_block;
! sapi_info.unblock=sapi_unblock;
sapi_info.log=sapi_log;
sapi_info.info=sapi_print_info;
/* Hack for annoying servers that do not set SCRIPT_FILENAME for us */
if (!sapi_info.script_filename) {
sapi_info.script_filename = sapi_info.argv0;
--- 151,168 ----
sapi_info.insert_header=sapi_insert_header;
sapi_info.send_header=sapi_send_header;
sapi_info.readclient=sapi_readclient;
! sapi_info.block_alarms=sapi_block;
! sapi_info.unblock_alarms=sapi_unblock;
sapi_info.log=sapi_log;
sapi_info.info=sapi_print_info;
+
+ sapi_info.hash_server_env=sapi_hash_server_env;
+ sapi_info.register_cleanup=sapi_reqister_cleanup;
+ sapi_info.request_shutdown=sapi_request_shutdown;
+ #if defined(CRASH_DETECTION)
+ sapi_info.debug_log=sapi_debug_log;
+ #endif
+
/* Hack for annoying servers that do not set SCRIPT_FILENAME for us */
if (!sapi_info.script_filename) {
sapi_info.script_filename = sapi_info.argv0;
- Next message: shane: "[PHP-DEV] CVS update: php31/main"
- Previous message: shane: "[PHP-DEV] CVS update: php31/main"
- Next in thread: shane: "[PHP-DEV] CVS update: php31/sapi"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

