CVS update: php31/sapi

From: Date: Tue, 11 Aug 1998 18:22:39 +0000
Subject: CVS update: php31/sapi
Groups: php.dev 
Request: Send a blank email to php-dev+get-106@lists.php.net to get a copy of this message
Date: Tuesday August 11, 1998 @ 14:22 Author: shane Update of /repository/php31/sapi In directory asf:/tmp/cvs-serv2616/sapi Modified Files: apache_sapi.c cgi_sapi.c isapi_sapi.c sapi.h Log Message: add aborting code to cgi and isapi. remove apache code from md5. Index: php31/sapi/apache_sapi.c diff -c php31/sapi/apache_sapi.c:2.2 php31/sapi/apache_sapi.c:2.3 *** php31/sapi/apache_sapi.c:2.2 Fri Jul 17 23:46:46 1998 --- php31/sapi/apache_sapi.c Tue Aug 11 14:22:38 1998 *************** *** 72,78 **** return ptr; } ! int sapi_readclient(SAPI_GLOBAL_INCLUDE char *buf, int length){ SAPI_FUNC_VARS; long bytes; #if MODULE_MAGIC_NUMBER > 19961007 --- 72,78 ---- return ptr; } ! int sapi_readclient(SAPI_GLOBAL_INCLUDE unsigned char *buf, int length){ SAPI_FUNC_VARS; long bytes; #if MODULE_MAGIC_NUMBER > 19961007 *************** *** 105,111 **** return bytes; } ! int sapi_insert_header(SAPI_GLOBAL_INCLUDE char *header){ char *rr = NULL; char *temp = NULL; long myuid = 0L; --- 105,111 ---- return bytes; } ! int sapi_insert_header(SAPI_GLOBAL_INCLUDE unsigned char *header){ char *rr = NULL; char *temp = NULL; long myuid = 0L; *************** *** 176,182 **** int sapi_send_header(SAPI_GLOBAL_INCLUDE_V){ CookieList *cookie; int len = 0; - char *tempstr; SAPI_FUNC_VARS; --- 176,181 ---- *************** *** 267,273 **** } /* this was php3_apache_puts*/ ! int sapi_puts(SAPI_GLOBAL_INCLUDE char *string){ SAPI_FUNC_VARS; if (php3_rqst) { --- 266,272 ---- } /* this was php3_apache_puts*/ ! int sapi_puts(SAPI_GLOBAL_INCLUDE unsigned char *string){ SAPI_FUNC_VARS; if (php3_rqst) { *************** *** 279,285 **** } /* this was php3_apache_putc */ ! int sapi_putc(SAPI_GLOBAL_INCLUDE char c){ SAPI_FUNC_VARS; if (php3_rqst) { --- 278,284 ---- } /* this was php3_apache_putc */ ! int sapi_putc(SAPI_GLOBAL_INCLUDE unsigned char c){ SAPI_FUNC_VARS; if (php3_rqst) { *************** *** 290,296 **** return FAILURE; } ! int sapi_writeclient(SAPI_GLOBAL_INCLUDE char *string, int len){ SAPI_FUNC_VARS; --- 289,295 ---- return FAILURE; } ! int sapi_writeclient(SAPI_GLOBAL_INCLUDE unsigned char *string, int len){ SAPI_FUNC_VARS; Index: php31/sapi/cgi_sapi.c diff -c php31/sapi/cgi_sapi.c:2.1 php31/sapi/cgi_sapi.c:2.2 *** php31/sapi/cgi_sapi.c:2.1 Tue Jul 7 19:13:44 1998 --- php31/sapi/cgi_sapi.c Tue Aug 11 14:22:38 1998 *************** *** 33,39 **** #define module_info NULL /* sapi functions */ ! int sapi_readclient(SAPI_GLOBAL_INCLUDE char *buf, int length){ int bytes=0,cnt = 0; do { bytes = fread(buf + cnt, 1, length - cnt, stdin); --- 33,39 ---- #define module_info NULL /* sapi functions */ ! int sapi_readclient(SAPI_GLOBAL_INCLUDE unsigned char *buf, int length){ int bytes=0,cnt = 0; do { bytes = fread(buf + cnt, 1, length - cnt, stdin); *************** *** 46,74 **** return getenv(string); } ! int sapi_insert_header(SAPI_GLOBAL_INCLUDE char *header){ puts(header); ! return puts("\015\012"); } int sapi_send_header(SAPI_GLOBAL_INCLUDE_V){ ! return puts("\015\012"); } int sapi_flush(SAPI_GLOBAL_INCLUDE_V){ return fflush(stdout); } ! int sapi_puts(SAPI_GLOBAL_INCLUDE char *string){ ! return puts(string); } ! int sapi_putc(SAPI_GLOBAL_INCLUDE char c){ ! return putc(c,stdout); } ! int sapi_writeclient(SAPI_GLOBAL_INCLUDE char *string, int len){ ! return fwrite(string,len,1,stdout); } void sapi_log(SAPI_GLOBAL_INCLUDE char *message){ --- 46,79 ---- return getenv(string); } ! int sapi_insert_header(SAPI_GLOBAL_INCLUDE unsigned char *header){ puts(header); ! if(!puts("\015\012"))sapi_info->abort=1; ! return SUCCESS; } int sapi_send_header(SAPI_GLOBAL_INCLUDE_V){ ! if(!puts("\015\012"))sapi_info->abort=1; ! return SUCCESS; } int sapi_flush(SAPI_GLOBAL_INCLUDE_V){ return fflush(stdout); } ! int sapi_puts(SAPI_GLOBAL_INCLUDE unsigned char *string){ ! if(!puts(string))sapi_info->abort=1; ! return SUCCESS; } ! int sapi_putc(SAPI_GLOBAL_INCLUDE unsigned char c){ ! if(!putc(c,stdout))sapi_info->abort=1; ! return SUCCESS; } ! int sapi_writeclient(SAPI_GLOBAL_INCLUDE unsigned char *string, int len){ ! if(!fwrite(string,len,1,stdout))sapi_info->abort=1; ! return SUCCESS; } void sapi_log(SAPI_GLOBAL_INCLUDE char *message){ *************** *** 88,94 **** void sapi_treat_headers(SAPI_GLOBAL_INCLUDE_V){ } int sapi_aborted(SAPI_GLOBAL_INCLUDE_V){ ! return 0; } #if defined(CRASH_DETECTION) --- 93,99 ---- void sapi_treat_headers(SAPI_GLOBAL_INCLUDE_V){ } int sapi_aborted(SAPI_GLOBAL_INCLUDE_V){ ! return sapi_info->abort; } #if defined(CRASH_DETECTION) *************** *** 180,185 **** --- 185,191 ---- sapi_info->log=sapi_log; sapi_info->info=sapi_print_info; sapi_info->aborted = sapi_aborted; + sapi_info->abort = 1; /*page stat info*/ sapi_info->page_uid=0; Index: php31/sapi/isapi_sapi.c diff -c php31/sapi/isapi_sapi.c:2.7 php31/sapi/isapi_sapi.c:2.8 *** php31/sapi/isapi_sapi.c:2.7 Sat Jul 18 19:52:29 1998 --- php31/sapi/isapi_sapi.c Tue Aug 11 14:22:38 1998 *************** *** 72,78 **** } #endif ! int sapi_readclient(SAPI_GLOBAL_INCLUDE char *buf, int len){ DWORD leftover; SAPI_FUNC_VARS; strncpy(buf,lpEcb->lpbData,lpEcb->cbAvailable); --- 72,78 ---- } #endif ! int sapi_readclient(SAPI_GLOBAL_INCLUDE unsigned char *buf, int len){ DWORD leftover; SAPI_FUNC_VARS; strncpy(buf,lpEcb->lpbData,lpEcb->cbAvailable); *************** *** 113,119 **** } /*FIXME need to make isapi correctly handle redirects and status strings*/ ! int sapi_insert_header(SAPI_GLOBAL_INCLUDE char *header){ char *tempstr=NULL,*r; SAPI_FUNC_VARS; /*inserts header into a list of headers*/ --- 113,119 ---- } /*FIXME need to make isapi correctly handle redirects and status strings*/ ! int sapi_insert_header(SAPI_GLOBAL_INCLUDE unsigned char *header){ char *tempstr=NULL,*r; SAPI_FUNC_VARS; /*inserts header into a list of headers*/ *************** *** 215,220 **** --- 215,221 ---- #if defined(CRASH_DETECTION) debug_log("sapi_send_header failure %s,%d\n",cfilename,clineno); #endif + sapi_info->abort=1; return FAILURE; } if(tempstr)efree(tempstr); *************** *** 277,283 **** return SUCCESS; } ! int sapi_puts(SAPI_GLOBAL_INCLUDE char *string){ SAPI_FUNC_VARS; int n; n = strlen(string); --- 278,284 ---- return SUCCESS; } ! int sapi_puts(SAPI_GLOBAL_INCLUDE unsigned char *string){ SAPI_FUNC_VARS; int n; n = strlen(string); *************** *** 286,297 **** #if defined(CRASH_DETECTION) debug_log("sapi_puts Failure called from %s,%d\n",cfilename,clineno); #endif return FAILURE; } return SUCCESS; } ! int sapi_putc(SAPI_GLOBAL_INCLUDE char c){ SAPI_FUNC_VARS; int n = 1; if (!lpEcb->WriteClient(lpEcb->ConnID,&c,&n,0)){ --- 287,299 ---- #if defined(CRASH_DETECTION) debug_log("sapi_puts Failure called from %s,%d\n",cfilename,clineno); #endif + sapi_info->abort=1; return FAILURE; } return SUCCESS; } ! int sapi_putc(SAPI_GLOBAL_INCLUDE unsigned char c){ SAPI_FUNC_VARS; int n = 1; if (!lpEcb->WriteClient(lpEcb->ConnID,&c,&n,0)){ *************** *** 299,316 **** #if defined(CRASH_DETECTION) debug_log("sapi_putc failure called from %s,%d\n",cfilename,clineno); #endif return FAILURE; } return SUCCESS; } ! int sapi_writeclient(SAPI_GLOBAL_INCLUDE char *string, int len){ SAPI_FUNC_VARS; if (!lpEcb->WriteClient(lpEcb->ConnID,string,&len,0)){ /*FIXME request_shutdown on failure! */ #if defined(CRASH_DETECTION) debug_log("sapi_writeclient failure called from %s,%d\n",cfilename,clineno); #endif return FAILURE; } return SUCCESS; --- 301,320 ---- #if defined(CRASH_DETECTION) debug_log("sapi_putc failure called from %s,%d\n",cfilename,clineno); #endif + sapi_info->abort=1; return FAILURE; } return SUCCESS; } ! int sapi_writeclient(SAPI_GLOBAL_INCLUDE unsigned char *string, int len){ SAPI_FUNC_VARS; if (!lpEcb->WriteClient(lpEcb->ConnID,string,&len,0)){ /*FIXME request_shutdown on failure! */ #if defined(CRASH_DETECTION) debug_log("sapi_writeclient failure called from %s,%d\n",cfilename,clineno); #endif + sapi_info->abort=1; return FAILURE; } return SUCCESS; *************** *** 328,334 **** } int sapi_aborted(SAPI_GLOBAL_INCLUDE_V){ ! return 0; } #if defined(CRASH_DETECTION) --- 332,339 ---- } int sapi_aborted(SAPI_GLOBAL_INCLUDE_V){ ! SAPI_FUNC_VARS; ! return sapi_info->abort; } #if defined(CRASH_DETECTION) *************** *** 441,446 **** --- 446,452 ---- sapi_info->log=sapi_log; sapi_info->info=sapi_print_info; sapi_info->aborted = sapi_aborted; + sapi_info->abort = 0; sapi_info->insert_header=sapi_insert_header; sapi_info->treat_headers=sapi_treat_headers; Index: php31/sapi/sapi.h diff -c php31/sapi/sapi.h:2.3 php31/sapi/sapi.h:2.4 *** php31/sapi/sapi.h:2.3 Sat Jul 18 19:36:29 1998 --- php31/sapi/sapi.h Tue Aug 11 14:22:39 1998 *************** *** 49,55 **** int current_user_length; unsigned int content_length; char *content_type; ! char *cookies; int cgi, display_source_mode,preprocess,info_only,quiet_mode; char *argv0,*ini_path,*script_filename; /* page stat vars */ --- 49,55 ---- int current_user_length; unsigned int content_length; char *content_type; ! unsigned char *cookies; int cgi, display_source_mode,preprocess,info_only,quiet_mode; char *argv0,*ini_path,*script_filename; /* page stat vars */ *************** *** 58,78 **** long page_mtime; /*handling headers*/ ! char *headers; /*pointer to header list*/ ! char *http_status; /* such as 401 Access Denied, needed for isapi*/ int http_redirect; /*used to signal redirect for isapi*/ ! int (*insert_header)(SAPI_GLOBAL_INCLUDE char *); /*insert header into a list*/ int (*send_header)(SAPI_GLOBAL_INCLUDE_V); /*write headers to client*/ void (*treat_headers)(SAPI_GLOBAL_INCLUDE_V); int (*aborted)(SAPI_GLOBAL_INCLUDE_V); /* returns: same as apaches php3_rqst->connection->aborted*/ /* io functions */ ! int (*readclient)(SAPI_GLOBAL_INCLUDE char *, int ); void (*info)(SAPI_GLOBAL_INCLUDE_V); ! void (*puts)(SAPI_GLOBAL_INCLUDE char *); ! void (*sputc)(SAPI_GLOBAL_INCLUDE char); char *(*getenv)(SAPI_GLOBAL_INCLUDE char *); ! int (*writeclient)(SAPI_GLOBAL_INCLUDE char *, int); void (*flush)(SAPI_GLOBAL_INCLUDE_V); /*flush writes to client*/ void (*log)(SAPI_GLOBAL_INCLUDE char *); /*use server error log*/ --- 58,79 ---- long page_mtime; /*handling headers*/ ! unsigned char *headers; /*pointer to header list*/ ! unsigned char *http_status; /* such as 401 Access Denied, needed for isapi*/ int http_redirect; /*used to signal redirect for isapi*/ ! int abort; ! int (*insert_header)(SAPI_GLOBAL_INCLUDE unsigned char *); /*insert header into a list*/ int (*send_header)(SAPI_GLOBAL_INCLUDE_V); /*write headers to client*/ void (*treat_headers)(SAPI_GLOBAL_INCLUDE_V); int (*aborted)(SAPI_GLOBAL_INCLUDE_V); /* returns: same as apaches php3_rqst->connection->aborted*/ /* io functions */ ! int (*readclient)(SAPI_GLOBAL_INCLUDE unsigned char *, int ); void (*info)(SAPI_GLOBAL_INCLUDE_V); ! void (*puts)(SAPI_GLOBAL_INCLUDE unsigned char *); ! void (*sputc)(SAPI_GLOBAL_INCLUDE unsigned char); char *(*getenv)(SAPI_GLOBAL_INCLUDE char *); ! int (*writeclient)(SAPI_GLOBAL_INCLUDE unsigned char *, int); void (*flush)(SAPI_GLOBAL_INCLUDE_V); /*flush writes to client*/ void (*log)(SAPI_GLOBAL_INCLUDE char *); /*use server error log*/ *************** *** 122,149 **** #endif /*emulates puts*/ ! extern int sapi_puts(SAPI_GLOBAL_INCLUDE char *); /*emulates putc*/ ! extern int sapi_putc(SAPI_GLOBAL_INCLUDE char); /*emulates getenv*/ extern char *sapi_getenv(SAPI_GLOBAL_INCLUDE char *); /*writes a string to the client*/ ! extern int sapi_writeclient(SAPI_GLOBAL_INCLUDE char *, int); /*flushes any writes to the client*/ extern int sapi_flush(SAPI_GLOBAL_INCLUDE_V); /*sends a header to the client, adds \n\r to the end*/ ! extern int sapi_insert_header(SAPI_GLOBAL_INCLUDE char *header); extern int sapi_send_header(SAPI_GLOBAL_INCLUDE_V); extern void sapi_treat_headers(SAPI_GLOBAL_INCLUDE_V); /*reads info from the client, used to get post fills the supplied buffer with the post data*/ ! extern int sapi_readclient(SAPI_GLOBAL_INCLUDE char *buf, int len); /*signal blocking so a signal doesnt interrupt us in a bad place (used in apache) */ extern void sapi_block(SAPI_GLOBAL_INCLUDE_V); --- 123,150 ---- #endif /*emulates puts*/ ! extern int sapi_puts(SAPI_GLOBAL_INCLUDE unsigned char *); /*emulates putc*/ ! extern int sapi_putc(SAPI_GLOBAL_INCLUDE unsigned char); /*emulates getenv*/ extern char *sapi_getenv(SAPI_GLOBAL_INCLUDE char *); /*writes a string to the client*/ ! extern int sapi_writeclient(SAPI_GLOBAL_INCLUDE unsigned char *, int); /*flushes any writes to the client*/ extern int sapi_flush(SAPI_GLOBAL_INCLUDE_V); /*sends a header to the client, adds \n\r to the end*/ ! extern int sapi_insert_header(SAPI_GLOBAL_INCLUDE unsigned char *header); extern int sapi_send_header(SAPI_GLOBAL_INCLUDE_V); extern void sapi_treat_headers(SAPI_GLOBAL_INCLUDE_V); /*reads info from the client, used to get post fills the supplied buffer with the post data*/ ! extern int sapi_readclient(SAPI_GLOBAL_INCLUDE unsigned char *buf, int len); /*signal blocking so a signal doesnt interrupt us in a bad place (used in apache) */ extern void sapi_block(SAPI_GLOBAL_INCLUDE_V); -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#106) next »