Re: [PHP-DEV] NSAPI patch / CVS access

2001-03-02 Thread Andi Gutmans

At 10:29 AM 3/2/2001 -0600, Andrew Johnson wrote:
>Andi Gutmans wrote:
> >
> > I just reviewed the patch quickly. Are you sure that using MALLOC() for the
> > SG(request_info) variables is OK?
>
>I think so.  php4_execute() contains
> nsapi_request_ctor(NSLS_C SLS_CC);
> retval = nsapi_module_main(NSLS_C SLS_CC);
> nsapi_request_dtor(NSLS_C SLS_CC);
>where the _ctor routine does the MALLOC()s and _dtor the FREE()s.

OK I just wanted to make sure that you guys checked this.


>(Appologies for my last unnecessary email Andi, I usually work through my
>email serially...).

Happens to me all the time :)

Andi


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] NSAPI patch / CVS access

2001-03-02 Thread Andrew Johnson

Andi Gutmans wrote:
> 
> I just reviewed the patch quickly. Are you sure that using MALLOC() for the
> SG(request_info) variables is OK?

I think so.  php4_execute() contains
nsapi_request_ctor(NSLS_C SLS_CC);
retval = nsapi_module_main(NSLS_C SLS_CC);
nsapi_request_dtor(NSLS_C SLS_CC);
where the _ctor routine does the MALLOC()s and _dtor the FREE()s.

(Appologies for my last unnecessary email Andi, I usually work through my
email serially...).

- Andrew
-- 
Every great idea appears crazy to start with.

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] NSAPI patch / CVS access

2001-03-02 Thread Andi Gutmans

I just reviewed the patch quickly. Are you sure that using MALLOC() for the 
SG(request_info) variables is OK?
Are these all variables which are supposed to be freed by the SAPI module? 
(I think they are but I don't have time to double check this). If the SAPI 
module is in charge then it's OK but if it's PHP (SAPI.c) then it probably 
isn't.

Andi

At 01:26 PM 3/2/2001 +0100, Whitehead Anthony wrote:
>Hiyas,
>
>I just tried to commit the attached patch to the NSAPI module but it seems my
>CVS write
>access has expired ;)
>
>Here attached is the patch for NSAPI from Andrew Johnson, I've tested it on
>several UNIX
>platforms and adjusted it slightly to allow patching of the latest CVS 
>version.
>
>If someone wants to commit this for us, or re-enable my CVS account I'd be
>happy.
>
>-Anthony Whitehead
>Central Data Services
>Swedish Social Security Ministry
>
>--
>PHP Development Mailing List 
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] NSAPI patch / CVS access

2001-03-02 Thread Andi Gutmans

I commited your patch.

Andi

At 01:26 PM 3/2/2001 +0100, Whitehead Anthony wrote:
>Hiyas,
>
>I just tried to commit the attached patch to the NSAPI module but it seems my
>CVS write
>access has expired ;)
>
>Here attached is the patch for NSAPI from Andrew Johnson, I've tested it on
>several UNIX
>platforms and adjusted it slightly to allow patching of the latest CVS 
>version.
>
>If someone wants to commit this for us, or re-enable my CVS account I'd be
>happy.
>
>-Anthony Whitehead
>Central Data Services
>Swedish Social Security Ministry
>
>--
>PHP Development Mailing List 
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] NSAPI patch / CVS access

2001-03-02 Thread Whitehead Anthony

Hiyas,

I just tried to commit the attached patch to the NSAPI module but it seems my
CVS write
access has expired ;)

Here attached is the patch for NSAPI from Andrew Johnson, I've tested it on
several UNIX
platforms and adjusted it slightly to allow patching of the latest CVS version.

If someone wants to commit this for us, or re-enable my CVS account I'd be
happy.

-Anthony Whitehead
Central Data Services
Swedish Social Security Ministry


? nsapi.patch
Index: nsapi.c
===
RCS file: /repository/php4/sapi/nsapi/nsapi.c,v
retrieving revision 1.16
diff -u -r1.16 nsapi.c
--- nsapi.c 2001/02/26 06:07:37 1.16
+++ nsapi.c 2001/03/02 12:14:08
@@ -94,15 +94,16 @@
 } nsapi_equiv;
 
 static nsapi_equiv nsapi_headers[] = {
-   { "CONTENT_LENGTH", "content-length" },
-   { "CONTENT_TYPE",   "content-type" },
-   { "HTTP_ACCEPT","accept" },
+   { "CONTENT_LENGTH", "content-length" },
+   { "CONTENT_TYPE",   "content-type" },
+   { "HTTP_ACCEPT","accept" },
{ "HTTP_ACCEPT_ENCODING",   "accept-encoding" },
{ "HTTP_ACCEPT_LANGUAGE",   "accept-language" },
+   { "HTTP_ACCEPT_CHARSET","accept-charset" },
{ "HTTP_AUTHORIZATION", "authorization" },
-   { "HTTP_COOKIE","cookie" },
+   { "HTTP_COOKIE","cookie" },
{ "HTTP_IF_MODIFIED_SINCE", "if-modified-since" },
-   { "HTTP_REFERER",   "referer" },
+   { "HTTP_REFERER",   "referer" },
{ "HTTP_USER_AGENT","user-agent" },
{ "HTTP_USER_DEFINED",  "user-defined" }
 };
@@ -113,20 +114,22 @@
{ "REQUEST_LINE",   "clf-request" },
{ "REQUEST_METHOD", "method" },
{ "SCRIPT_NAME","uri" },
-   { "SCRIPT_PROTOCOL","protocol" }
+   { "SERVER_PROTOCOL","protocol" }
 };
 static size_t nsapi_reqpb_size = sizeof(nsapi_reqpb)/sizeof(nsapi_reqpb[0]);
 
 static nsapi_equiv nsapi_vars[] = {
-   { "AUTH_TYPE",  "auth-type" },
{ "PATH_INFO",  "path-info" },
+   { "PATH_TRANSLATED","path" },
+   { "AUTH_TYPE",  "auth-type" },
+   { "CLIENT_CERT","auth-cert" },
{ "REMOTE_USER","auth-user" }
 };
 static size_t nsapi_vars_size = sizeof(nsapi_vars)/sizeof(nsapi_vars[0]);
 
 static nsapi_equiv nsapi_client[] = {
{ "HTTPS_KEYSIZE",  "keysize" },
-   { "HTTPS_SECRETSIZE",   "secret-keysize" },
+   { "HTTPS_SECRETSIZE",   "secret-keysize" },
{ "REMOTE_ADDR","ip" }
 };
 static size_t nsapi_client_size = sizeof(nsapi_client)/sizeof(nsapi_client[0]);
@@ -279,47 +282,67 @@
 {
nsapi_request_context *rc = (nsapi_request_context *)SG(server_context);
size_t i;
-   char *value = NULL;
+   char *value;
char buf[128];
 
-   *buf = 0;
for (i = 0; i < nsapi_reqpb_size; i++) {
-   if ((value = pblock_findval(nsapi_reqpb[i].nsapi_eq, rc->rq->reqpb)) 
== NULL) {
-   value = buf;
+   value = pblock_findval(nsapi_reqpb[i].nsapi_eq, rc->rq->reqpb);
+   if (value) {
+   php_register_variable( (char *)nsapi_reqpb[i].env_var, value, 
+track_vars_array ELS_CC PLS_CC );
}
-   php_register_variable( (char *)nsapi_reqpb[i].env_var, value, 
track_vars_array ELS_CC PLS_CC );
}

for (i = 0; i < nsapi_headers_size; i++) {
-   if ((value = pblock_findval(nsapi_headers[i].nsapi_eq, 
rc->rq->headers)) == NULL) {
-   value = buf;
+   value = pblock_findval(nsapi_headers[i].nsapi_eq, rc->rq->headers);
+   if (value) {
+   php_register_variable( (char *)nsapi_headers[i].env_var, 
+value, track_vars_array ELS_CC PLS_CC );
}
-   php_register_variable( (char *)nsapi_headers[i].env_var, value, 
track_vars_array ELS_CC PLS_CC );
}
 
for (i = 0; i < nsapi_vars_size; i++) {
-   if ((value = pblock_findval(nsapi_vars[i].nsapi_eq, rc->rq->vars)) == 
NULL) {
-   value = buf;
+   value = pblock_findval(nsapi_vars[i].nsapi_eq, rc->rq->vars);
+   if (value) {
+   php_register_variable( (char *)nsapi_vars[i].env_var, value, 
+track_vars_array ELS_CC PLS_CC );
}
-   php_register_variable( (char *)nsapi_vars[i].env_var, value, 
track_vars_array ELS_CC PLS_CC );
}
 
for (i = 0; i < nsapi_client_size; i++) {
-   if ((value = pblock_findval(nsapi_client[i].nsapi_eq, rc->sn->client)) 
== NULL) {
-