CVS update: php31/sapi
| From: | shane | Date: | Tue, 25 Aug 1998 22:52:29 +0000 |
| Subject: | CVS update: php31/sapi | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-581@lists.php.net to get a copy of this message | ||
Date: Tuesday August 25, 1998 @ 18:52
Author: shane
Update of /repository/php31/sapi
In directory asf:/u2/tmp/cvs-serv27404/sapi
Modified Files:
wsapi_sapi.c
Log Message:
wsapi with ora website now parses files. Cookies and Authentication are still
broken.
Index: php31/sapi/wsapi_sapi.c
diff -c php31/sapi/wsapi_sapi.c:2.1 php31/sapi/wsapi_sapi.c:2.2
*** php31/sapi/wsapi_sapi.c:2.1 Tue Aug 25 17:22:55 1998
--- php31/sapi/wsapi_sapi.c Tue Aug 25 18:52:26 1998
***************
*** 159,166 ****
*r = ':';
strcpy(tp->content_encoding,(r + 2));
}else{
tp->rsp_xhdr[tp->num_rsp_xhdr].key=wsapi_strdup(header, tp);
! tp->rsp_xhdr[tp->num_rsp_xhdr].value=wsapi_strdup((r+2), tp);
tp->num_rsp_xhdr++;
}
*r = ':';
--- 159,167 ----
*r = ':';
strcpy(tp->content_encoding,(r + 2));
}else{
+ char *temp=(r+2);
tp->rsp_xhdr[tp->num_rsp_xhdr].key=wsapi_strdup(header, tp);
! tp->rsp_xhdr[tp->num_rsp_xhdr].value=wsapi_strdup(temp, tp);
tp->num_rsp_xhdr++;
}
*r = ':';
***************
*** 311,324 ****
PUTS("</table>\n");
}
struct sapi_request_info *sapi_init(TCTX *tp)
{
struct sapi_request_info *sapi_info = malloc(sizeof(struct sapi_request_info));
sapi_info->scid = tp;
sapi_info->path_info = _sapi_getenv(tp, "PATH_INFO");
sapi_info->path_translated = tp->url;
! sapi_info->rqst_filename = tp->url;
sapi_info->filename = NULL; /* we will estrdup rqst_filename later */
sapi_info->query_string = _sapi_getenv(tp, "QUERY_STRING");
sapi_info->current_user = NULL;
--- 312,349 ----
PUTS("</table>\n");
}
+ char *_wsapi_build_cookies(TCTX *tp)
+ {
+ int i,p=0;
+ char *cookies=NULL;
+ char buf[MAX_BUFF_SIZE];
+
+ for(i = 0; i < tp->num_req_xhdr; i++) // Search for cookie
+ if(lstrcmpi("Cookie", tp->req_xhdr[i].key) == 0 && p<MAX_BUFF_SIZE){
+ strncpy(buf+p,tp->req_xhdr[i].key,MAX_BUFF_SIZE-p);
+ p=strlen(buf);
+ buf[p]='=';
+ p++;
+ buf[p]='\0';
+ p++;
+ }
+ return strdup(buf);
+ }
+
struct sapi_request_info *sapi_init(TCTX *tp)
{
struct sapi_request_info *sapi_info = malloc(sizeof(struct sapi_request_info));
+ char buf[MAX_STRING_LEN];
+ int type;
+ strcpy(buf,tp->url);
+ type=url_to_file(buf, TRUE, tp);
sapi_info->scid = tp;
sapi_info->path_info = _sapi_getenv(tp, "PATH_INFO");
sapi_info->path_translated = tp->url;
! if(type==STD_DOCUMENT){
! sapi_info->rqst_filename = strdup(buf);
! }
sapi_info->filename = NULL; /* we will estrdup rqst_filename later */
sapi_info->query_string = _sapi_getenv(tp, "QUERY_STRING");
sapi_info->current_user = NULL;
***************
*** 327,333 ****
sapi_info->script_name = _sapi_getenv(tp, "SCRIPT_NAME");
sapi_info->content_length = tp->content_length;
sapi_info->content_type = tp->content_type;
! sapi_info->cookies = _sapi_getenv(tp, "HTTP_COOKIE");
sapi_info->authorization = tp->auth_line;
sapi_info->getenv = sapi_getenv;
--- 352,358 ----
sapi_info->script_name = _sapi_getenv(tp, "SCRIPT_NAME");
sapi_info->content_length = tp->content_length;
sapi_info->content_type = tp->content_type;
! sapi_info->cookies = _wsapi_build_cookies(tp);
sapi_info->authorization = tp->auth_line;
sapi_info->getenv = sapi_getenv;
***************
*** 384,390 ****
/* this is php3_isapi_main()!!! */
! DWORD WINAPI wsapi_php_main(TCTX *tp)
{
int ret = 0;
struct sapi_request_info *sapi_info;
--- 409,415 ----
/* this is php3_isapi_main()!!! */
! BOOL Process(TCTX *tp)
{
int ret = 0;
struct sapi_request_info *sapi_info;
--
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