CVS update: php31/sapi
| From: | shane | Date: | Fri, 21 Aug 1998 20:15:50 +0000 |
| Subject: | CVS update: php31/sapi | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-446@lists.php.net to get a copy of this message | ||
Date: Friday August 21, 1998 @ 16:15
Author: shane
Update of /repository/php31/sapi
In directory asf:/tmp/cvs-serv2745/sapi
Modified Files:
isapi_sapi.c sapi.h
Log Message:
adding internal sapi_writeclient back into code. still need to work out
defines.
Index: php31/sapi/isapi_sapi.c
diff -c php31/sapi/isapi_sapi.c:2.12 php31/sapi/isapi_sapi.c:2.13
*** php31/sapi/isapi_sapi.c:2.12 Fri Aug 21 13:30:16 1998
--- php31/sapi/isapi_sapi.c Fri Aug 21 16:15:50 1998
***************
*** 145,154 ****
*r = '\0';
if (!strcasecmp(header, "Location")) {
*r = ':';
! if (*(r + 1) == '/' || *(r + 2) == '/') { /*local redirect */
! sapi_info->http_redirect = 2;
! } else { /*redirect to remote system */
sapi_info->http_redirect = 1;
}
sapi_info->http_status = estrdup(r + 1);
return SUCCESS;
--- 145,154 ----
*r = '\0';
if (!strcasecmp(header, "Location")) {
*r = ':';
! if (strspn((r+1),"://")) {/*redirect to remote system */
sapi_info->http_redirect = 1;
+ } else { /*local redirect */
+ sapi_info->http_redirect = 2;
}
sapi_info->http_status = estrdup(r + 1);
return SUCCESS;
***************
*** 400,422 ****
int i = 0;
SAPI_FUNC_VARS;
! sapi_puts(SAPI_GLOBAL_PASS "<center><h2>ISAPI Request
Environment</h2></center>");
! sapi_puts(SAPI_GLOBAL_PASS "<table border=5 width=\"600\">\n");
! sapi_puts(SAPI_GLOBAL_PASS "<tr><th bgcolor=\"" HEADER_COLOR
"\">Variable</th><th bgcolor=\"" HEADER_COLOR
"\">Value</th></tr>\n");
while (isapi_env[i] != NULL) {
temp = sapi_getenv(SAPI_GLOBAL_PASS isapi_env[i]);
! sapi_puts(SAPI_GLOBAL_PASS "<tr><td bgcolor=\"" ENTRY_NAME_COLOR
"\">");
! sapi_puts(SAPI_GLOBAL_PASS isapi_env[i]);
! sapi_puts(SAPI_GLOBAL_PASS "</td><td bgcolor=\"" CONTENTS_COLOR
"\">");
if (temp) {
! sapi_puts(SAPI_GLOBAL_PASS temp);
}
! sapi_puts(SAPI_GLOBAL_PASS " </td></tr>\n");
if (temp)
efree(temp);
i++;
}
! sapi_puts(SAPI_GLOBAL_PASS "</table>\n");
}
struct sapi_request_info *sapi_init(LPEXTENSION_CONTROL_BLOCK lpEcb)
--- 400,422 ----
int i = 0;
SAPI_FUNC_VARS;
! INT_PUTS("<center><h2>ISAPI Request
Environment</h2></center>");
! INT_PUTS("<table border=5 width=\"600\">\n");
! INT_PUTS("<tr><th bgcolor=\"" HEADER_COLOR
"\">Variable</th><th bgcolor=\"" HEADER_COLOR
"\">Value</th></tr>\n");
while (isapi_env[i] != NULL) {
temp = sapi_getenv(SAPI_GLOBAL_PASS isapi_env[i]);
! INT_PUTS("<tr><td bgcolor=\"" ENTRY_NAME_COLOR "\">");
! INT_PUTS(isapi_env[i]);
! INT_PUTS("</td><td bgcolor=\"" CONTENTS_COLOR "\">");
if (temp) {
! INT_PUTS(temp);
}
! INT_PUTS(" </td></tr>\n");
if (temp)
efree(temp);
i++;
}
! INT_PUTS("</table>\n");
}
struct sapi_request_info *sapi_init(LPEXTENSION_CONTROL_BLOCK lpEcb)
Index: php31/sapi/sapi.h
diff -c php31/sapi/sapi.h:2.10 php31/sapi/sapi.h:2.11
*** php31/sapi/sapi.h:2.10 Fri Aug 21 12:52:23 1998
--- php31/sapi/sapi.h Fri Aug 21 16:15:50 1998
***************
*** 112,122 ****
extern struct sapi_request_info *sapi_rqst;
#endif
#define PHPWRITE(a,n) php3_write((a),(n))
! #define PUTS(s) { char *str=(s); PHPWRITE(s,strlen(s)); }
! #define PUTC(c) { char ch=(c); PHPWRITE(&ch, 1); }
#ifndef COMPILE_DL
#define BLOCK_INTERRUPTIONS
if(GLOBAL(sapi_rqst))GLOBAL(sapi_rqst)->blockalarms(SAPI_GLOBAL_PASS_V)
#define UNBLOCK_INTERRUPTIONS
if(GLOBAL(sapi_rqst))GLOBAL(sapi_rqst)->unblockalarms(SAPI_GLOBAL_PASS_V)
#endif
--- 112,128 ----
extern struct sapi_request_info *sapi_rqst;
#endif
+ /* these three defines must allways be available to deal with function
+ modules that may or may not be staticly compiled */
#define PHPWRITE(a,n) php3_write((a),(n))
! #define PUTS(s) { unsigned char *str=(s); PHPWRITE(str,strlen(str)); }
! #define PUTC(c) { unsigned char ch=(c); PHPWRITE(&ch, 1); }
#ifndef COMPILE_DL
+ #define INT_PHPWRITE(a,n) php3_sapi_writeclient((a),(n) _INLINE_TLS)
+ #define INT_PUTS(s) { unsigned char *str=(s); INT_PHPWRITE(str,strlen(str)); }
+ #define INT_PUTC(c) { unsigned char ch=(c); INT_PHPWRITE(&ch, 1); }
+
#define BLOCK_INTERRUPTIONS
if(GLOBAL(sapi_rqst))GLOBAL(sapi_rqst)->blockalarms(SAPI_GLOBAL_PASS_V)
#define UNBLOCK_INTERRUPTIONS
if(GLOBAL(sapi_rqst))GLOBAL(sapi_rqst)->unblockalarms(SAPI_GLOBAL_PASS_V)
#endif
--
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