hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 35383] - HttpMethod abort does not cancel immediately if HttpClient executeMethod hangs on socket opening
Date Thu, 16 Jun 2005 09:44:21 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35383>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35383





------- Additional Comments From bchevill.ml@gmail.com  2005-06-16 11:44 -------
Resume of action to take and what's wrong:

Pb reason:
It does not work on HttpClient, because the abort() method close only
the InputStream which is not already created at this moment (since the
socket hangs on opening).
Actually, the socket.connect() method can be canceled with
socket.close(): see the class attached

There are 2 problems:
- the socket is open within the same call of its creation (so we don't
have a pointer to it, to close it).
- the abort() method has no way to call the close() method deeply.

Solution:
To resolve it, there should be 2 calls to ReflectionSocketFactory in
HttpConnection:
- One to create the socket (until bind). This method always return
immediately and this way, we could have a variable that points to the
Socket instance.
- A second call to connect the socket.
If the second call hangs, then we could call HttpConnection.close()
since the socket variable is not null.

Finally, there should be a way to for the HttpClient to close the
HttpConnection which concerns it.

Troubles:
The trouble is that the changes you are suggesting cannot be implemented without
breaking the existing API.
Besides, ability to create unconnected sockets has been introduced in
Java 1.4 and cannot be easily simulated in older versions, whereas
HttpClient must stay Java 1.2 compatible until next major release (4.0
that is).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org


Mime
View raw message