libwww Bug report

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 UTC