[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: [Fwd: Fwd: kfm 1.85 (fwd)]
From:       David Faure <David.Faure () insa-lyon ! fr>
Date:       1999-01-21 14:20:50
[Download RAW message or body]

> > ---------- Forwarded message ----------
> > Date: Fri, 15 Jan 1999 20:39:19 -0400
> > From: Hume Smith <hclsmith@glinx.com>
> > To: kfm author <weis@kde.org>
> > Subject: kfm 1.85
> > 
> > when it fails to connect to the proxy, it complains about not being able to \
> > connect to the machine in the URL - a bit counterintuitive. 
> > how hard would it be to make it say "can't connect to proxy" and then attempt \
> > direct access? 
> > --
> > <URL:http://www.glinx.com/users/hclsmith/>
> 
> Much to my surprise kioslave sets the correct error message.
> However this error message is totally discarded and only the 
> involved URL is send back to KFM.
> 
> This will not be fixed since it involves rewriting kioslave.

There is no surprise. The error reporting from kioslave is a bit weird :
the second argument of the Error() method is a string that is _not_ sent to 
kfm. It must be for internal use only, I guess.
So kfm (kiojob precisely) only gets a KIO_ERROR_CouldNotConnect, hence the
error message (see kiojob.cpp line 1322).

Two things that could be done 
* add a new KIO_ERROR code to make the message clear. Blah.
* attempt direct access if proxy didn't work. Very easy to do, but is that
   ok ? I mean, do any user want this ? Some might have, I don't know, logs 
   generated when trying a direct access, and then being fired for this ? :))

Waiting for your opinion.


The patch for the second solution is straightforward :
Index: http.cpp
===================================================================
RCS file: /home/kde/kdebase/kfm/kioslave/http.cpp,v
retrieving revision 1.40
diff -u -p -r1.40 http.cpp
--- http.cpp	1999/01/18 21:02:54	1.40
+++ http.cpp	1999/01/21 14:15:04
@@ -495,12 +495,9 @@ int KProtocolHTTP::OpenHTTP( KURL *_url,
 	  // inet_ntoa(proxy_name.sin_addr),
 	  // ntohs(proxy_name.sin_port));
 		if(::connect(sock,(struct sockaddr*)(&proxy_name),sizeof(proxy_name)))
-		{
-	    	Error(KIO_ERROR_CouldNotConnect,"Could not connect to proxy",errno);
-	    	return(FAIL);
-		}
+		  do_proxy = false; // proxy failed : attempt direct access
 	}
-	else
+	if (!do_proxy)
 	{
 		struct sockaddr_in server_name;
 		int port = _url->port();


-- 
 ____________________________________________________________________
> > 
> David FAURE                                                       |
> E-mail : David.Faure@insa-lyon.fr, faure@kde.org                  |
> http://www.insa-lyon.fr/People/AEDI/dfaure/index.html             |
> ____________________________________________________________________|


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic