Bug 101149 - socks support not releasing for local network
Summary: socks support not releasing for local network
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unmaintained
Component: http (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-09 08:54 UTC by Mr E_T
Modified: 2005-03-10 19:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Attempt at fixing the problem (592 bytes, patch)
2005-03-09 12:33 UTC, Thiago Macieira
Details
Another attempt (549 bytes, patch)
2005-03-10 02:11 UTC, Thiago Macieira
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mr E_T 2005-03-09 08:54:32 UTC
Version:            (using KDE KDE 3.3.1)
Installed from:    Compiled From Sources
Compiler:          gcc 3.4.3 
OS:                Linux

I use -
  dante        1.1.15
  squid        2.5.STABLE9
  dansguardian 2.8.0.4

mozilla firfox with socks support will honor the no-proxy-for list and switch off socks for the local network.

konqueror will not.

This is annoying as dansguardian uses identd to identify the user - but as konqueror forces the connection through the socks server I can only get the socks daemon username.

windows xp ie also works fine.

It seems that the default behaviour should be to use EITHER a socks proxy or a http/https/ftp/gopher proxy such as squid.

Currently konqueror tries to use both which upsets the protocol chain and loses ident information.
Comment 1 Thiago Macieira 2005-03-09 12:33:19 UTC
Created attachment 10036 [details]
Attempt at fixing the problem

Let me see if I understand you correctly.

You are saying Konqueror is trying to open a connection to your local website
using SOCKS, when it shouldn't.

Is this your current config:
- you have an HTTP proxy configured for Konqueror
- you have the SOCKS global proxy configured, for all KDE applications

If that's the case, please try the attached patch. See if it solves your
problem.
Comment 2 Mr E_T 2005-03-09 13:26:54 UTC
Yes - I have found that with socks and http proxies enabled konqueror tries to use socks to get to the http proxy.

This is not the behavior of mozilla or windows IE

I am compiling the patch to try now
Comment 3 Thiago Macieira 2005-03-09 14:16:23 UTC
> Yes - I have found that with socks and http proxies enabled konqueror tries
> to use socks to get to the http proxy.

That's what I feared. The code agrees with that conclusion. What's more, it's been around since KDE 2.2 and no one had noticed it -- probably because no one uses SOCKS and HTTP proxies.
Comment 4 Mr E_T 2005-03-09 14:50:22 UTC
Sorry that patch did not work.
Comment 5 Thiago Macieira 2005-03-09 15:43:31 UTC
Did it not apply, did it fail compiling, or did it not work?

After you've rebuilt kio_http, did you install it? Make sure you killed all the remaining kio_http processes.
Comment 6 Mr E_T 2005-03-09 16:04:05 UTC
It compiled but appeared not to make a difference.

The connection still went through socks to get to the http connection!

Comment 7 Mr E_T 2005-03-10 01:22:48 UTC
I have founf another socks(dante) issue with the connection.

in /etc/socks.conf are routeing directives for the socks library.

one of which is this one to force a direct connection to local machines.
route {
       from: 0.0.0.0/0 to: 191.168.1.1.0/24 via: direct
}

If I comment it out it works fine - but if I leave it in then kmail, konqueror etc crash. -

pts/53:~ >konqueror
konqueror: ERROR: Error in BrowserExtension::actionSlotMap(), unknown action : searchProvider
konqueror: ERROR: Error in BrowserExtension::actionSlotMap(), unknown action : searchProvider
kdecore (KLibLoader): WARNING: KLibrary: /opt/kde/lib/libkdecore.so.4: undefined symbol: S5LogShowThreadIDS
pts/53:~ >kmail
kdecore (KLibLoader): WARNING: KLibrary: /opt/kde/lib/libkdecore.so.4: undefined symbol: S5LogShowThreadIDS

So there would appear to be 2 socks related problems here.

1.) kio should use either socks or httpd proxy.
2.) There appears to be a missing function/symbol when using dante.

Thanx.
Comment 8 Thiago Macieira 2005-03-10 01:59:05 UTC
Never mind that warning, that's kdecore testing for NEC SOCKS.

If you have a crash, please open another bug report against kdelibs and include the backtrace.
Comment 9 Thiago Macieira 2005-03-10 02:11:18 UTC
Created attachment 10054 [details]
Another attempt

Please try this patch now.

I don't know why the first one didn't work... Please revert it.
Comment 10 Mr E_T 2005-03-10 05:16:55 UTC
That one seems to work - Ill letyou know in about a day if there are any problems.

But first glance seems to be that youve got it.
Comment 11 Mr E_T 2005-03-10 13:05:22 UTC
OK It works.
My ident procedures are absolutey fine now Thanx.
Comment 12 Thiago Macieira 2005-03-10 13:42:12 UTC
CVS commit by thiago: 

Committing a fix for bug 101149: kio_http does its own proxying, so no
need to use KSocks for anything. This, however, means that kio_http no
longer abides by the global SOCKS proxy rule -- then again, there's a
specific KCM for configuring kio_http's proxies, with no option "use
global SOCKS proxies". That's something to be fixed in the future.

To be backported.
BUG:101149


  M +2 -0      http.cc   1.641


--- kdelibs/kioslave/http/http.cc  #1.640:1.641
@@ -1958,4 +1958,6 @@ bool HTTPProtocol::httpOpenConnection()
 
   setBlockConnection( true );
+  // kio_http uses its own proxying:
+  KSocks::self()->disableSocks();
 
   if ( m_state.doProxy )
Comment 13 Thiago Macieira 2005-03-10 13:50:24 UTC
CVS commit by thiago: 

(Backport 1.640:1.641) Backporting the fix thatfixed bug 101149.
CCBUG:101149


  M +2 -0      http.cc   1.637.2.2


--- kdelibs/kioslave/http/http.cc  #1.637.2.1:1.637.2.2
@@ -1951,4 +1951,6 @@ bool HTTPProtocol::httpOpenConnection()
 
   setBlockConnection( true );
+  // kio_http uses its own proxying:
+  KSocks::self()->disableSocks();
 
   if ( m_state.doProxy )
Comment 14 Waldo Bastian 2005-03-10 14:58:55 UTC
I don't think it should be disabled if no proxy is used.

Cheers,
Waldo

On Thursday 10 March 2005 13:50, Thiago Macieira wrote:
> --- kdelibs/kioslave/http/http.cc  #1.637.2.1:1.637.2.2
>  @ -1951,4 +1951,6  @ bool HTTPProtocol::httpOpenConnection()
>
>    setBlockConnection( true );
> +  // kio_http uses its own proxying:
> +  KSocks::self()->disableSocks();
>
>    if ( m_state.doProxy )

Comment 15 Thiago Macieira 2005-03-10 19:33:24 UTC
As I said, there's no option to "Use global SOCKS" settings, but there is the "Direct Internet connection". Maybe we should just update the dialog to provide this extra option.