Github user dmap commented on the issue:

    https://github.com/apache/httpcomponents-core/pull/94
  
    @ok2c So this is now working... but I'm not totally happy with it.  There 
are a couple of strange interactions required between the 
SocksProxyProtocolHandler and the InternalDataChannel to have things work.  
    
    1. The only way to have the `connected()` method called on the next event 
handler in the chain at the right time for both the SSL and non-SSL cases was 
to have the InternalDataChannel do it (because it knows if there is a 
tlsSession or not), so I had to create the reconnectHandler() method to reset 
the state of the `connected` flag so it would actually make the call.  The 
InternalDataChannel had already called `connected()` on the 
SocksProxyProtocolHandler and so didn't think it needed to call it again.
    
    1. There is something awkward about the handling of the selection key 
interest ops.  Specifically `IOSessionImpl.enqueue()` adds `OP_WRITE` to the 
current event mask, but the current IO event handler may have no ability to 
process the enqueued command.  It took me some time to work out why my 
`SocksProxyProtocolHandler` was suddenly getting `outputReady` callbacks when 
it hadn't specified any interest in writing output.  I think it would be 
cleaner to fire some other type of event when a command is queued and let the 
current IO event handler make the appropriate changes to the interest ops.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to