W3C home > Mailing lists > Public > www-lib@w3.org > July to September 2000

libwww Bug report

From: <vkruglikov@handspring.com>
Date: Thu, 21 Sep 2000 17:41:51 -0700
Message-ID: <564E3AA04C45D41183CC00508BC8239A1EA320@dogbert.corp.handspring.com>
To: jose@w3.org
File: HTAABrow.c, v5.3.1

Please note that the comparison "status == HT_NO_ACCESS " at the end of the
code snippet (see below) can never be true because that statement lies
inside the "if (proxy)" block and "proxy" is set to true only if
"status==HT_NO_PROXY_ACCESS ".  So, if "status" is already
"HT_NO_PROXY_ACCESS", then it cannot also be "HT_NO_ACCESS" at the same
time.

Best regards,

Vitaly

P.S.  This is my first venture into the LibWWW sources, so please fogive me
if I am sending this to the wrong person.

>>>>>>>>>>>
PUBLIC int HTBasic_parse (HTRequest * request, HTResponse * response,
			  void * context, int status)
{
    HTAssocList * challenge = HTResponse_challenge(response);
    HTBasic * basic = NULL;
    BOOL proxy = status==HT_NO_PROXY_ACCESS ? YES : NO;
    if (request && challenge) {
	char * p = HTAssocList_findObject(challenge, BASIC_AUTH);
	char * realm = HTNextField(&p);
	char * rm = HTNextField(&p);

	/*
	** If valid challenge then make a template for the resource and
	** store this information in our authentication URL Tree
	*/
	if (realm && !strcasecomp(realm, "realm") && rm) {
	    HTTRACE(AUTH_TRACE, "Basic Parse. Realm `%s\' found\n" _ rm);
	    HTRequest_setRealm(request, rm);

	    /*
	    **  If we are in proxy mode then add the proxy - not the final
URL
	    */
	    if (proxy) {
		char * url = HTRequest_proxy(request);
		HTTRACE(AUTH_TRACE, "Basic Parse. Proxy authentication\n");
		basic = (HTBasic *) HTAA_updateNode(proxy, BASIC_AUTH, rm,
						    url, NULL);
		/* if the previous authentication failed, then try again */
		if (HTRequest_AAretrys (request) > 1 
		    && status == HT_NO_ACCESS && basic)
		  basic->retry = YES;
	    } else {

<<<<<<<<<<<
Received on Friday, 22 September 2000 02:48:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:38 GMT