perhaps all you need to do is modify the code behind nsISocketProvider 
for SOCKS (which is implemented by PSM) and disable DNS lookups for the 
socket transport some how (there's already code in doConnection that 
shows how to test if SOCKS is being used).

reuse of open sockets is managed at a higher level.  for HTTP, see 
nsHttpHandler/nsHttpConnection.

darin



Justin Bradford wrote:
> I'm interested in fixing bug 134105 to allow DNS resolving to be done on 
> the SOCKS proxy server rather than by mozilla. I believe the best 
> approach is to extend the PRNetAddr union to include another struct 
> which contains the hostname (as a char string) and port, rather than the 
> IP. Any thoughts?
> 
> Also, I could extend PRNetAddr one of two ways:
> 1) Add a new address family for the hostname/port struct.
> 2) Add a non-overlapping struct so that the hostname/port portion of the 
> struct is always accessible, but optional (ie. it would only be set if 
> in the appropriate SOCKS mode). The SOCKS IO layer would then check for 
> it if the IP is invalid.
> 
> I feel #1 is the "right" thing to do, but I feel that it has more 
> potential to break code elsewhere. Perhaps there are places in the code 
> that assume the address family is one of the currently implemented ones.
> 
> As for setting this hostname information, my plan was to "short-circuit" 
> doResolveHost in nsSocketTransport.cpp by initializing mNetAddress 
> during Init.
> 
> One other concern: When connected socket transports are reused, how does 
> it check the destination? Does it look directly at mNetAddress, or is it 
> higher level? I can track this down myself, but I thought I'd see if 
> anyone knows offhand.
> 
> Anyway, I just wanted to make sure my approach was ok and shouldn't 
> cause any problems. If it looks good, I'll start on a patch.
> 
> Justin
> 


Reply via email to