DO NOT REPLY [Bug 28354] - unable to find line starting with "HTTP" message when timeout occurs

2004-04-14 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=28354

unable to find line starting with "HTTP" message when timeout occurs

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID



--- Additional Comments From [EMAIL PROTECTED]  2004-04-14 17:04 ---
I am glad the issue is resolved. I am looking forward to receiving your
contribution. You may post it to the HttpClient developers' mailing list if you
like, and I'll see that it gets incorporated into HttpClient SSL guide.

Oleg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 28354] - unable to find line starting with "HTTP" message when timeout occurs

2004-04-14 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=28354

unable to find line starting with "HTTP" message when timeout occurs





--- Additional Comments From [EMAIL PROTECTED]  2004-04-14 16:48 ---
Hi Oleg!

That's it. With JDK 1.4.2 and the bundled JSSE I 
get "java.net.SocketTimeoutException: Read timed out".

Feel free to mark the bug invalid. I'll send you the contribution to be added 
via email.

Again, thanks a lot for your help.
Daniel C. Amadei

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 28354] - unable to find line starting with "HTTP" message when timeout occurs

2004-04-13 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=28354

unable to find line starting with "HTTP" message when timeout occurs





--- Additional Comments From [EMAIL PROTECTED]  2004-04-13 16:57 ---
Daniel,
SSLSocket timeouts in JSSE prior to JDK 1.4 appear plain broken. There's
sufficient evidence that JSSE bundled with JDK 1.4 is much better in this
regard. If this is possible, give Java 1.4 a shot. It may not exhibit this problem

The problems with SSL in older version of Java platforms are documented here
 You are welcome to
contribute a paragraph describing the problem you have been experiencing. We'd
greatly appreciate such contribution.

With your permission, I'll mark this bug report as invalid

Oleg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 28354] - unable to find line starting with "HTTP" message when timeout occurs

2004-04-13 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=28354

unable to find line starting with "HTTP" message when timeout occurs





--- Additional Comments From [EMAIL PROTECTED]  2004-04-13 15:49 ---
Hi Oleg!

I'm using jdk 1.3.1_01 on WIndows and 1.3.1_07 on HP-UX.

I did the test using a JSP that calls the Thread.sleep method with a wait of 
1ms. When using HTTP I get the same error as you: "InterruptedIOException: 
Read timed out"

Using HTTPS, I get the "unable to find line starting with HTTP" error using the 
same JSP as the target URL.

So, you are right when you tell that it's related to the use of SSL. I think 
that if you just inform that this error can be caused by the timeout when using 
SSL will help a lot when other people get the same error because they will be 
able to go straight to the point and not loose time searching for 
network/connection problems like I did.

Thanks again,
Daniel

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 28354] - unable to find line starting with "HTTP" message when timeout occurs

2004-04-13 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=28354

unable to find line starting with "HTTP" message when timeout occurs





--- Additional Comments From [EMAIL PROTECTED]  2004-04-13 08:37 ---
Daniel,
This may help you a little. Here's the code that throws the recoverable
exception in question:
==
protected void readStatusLine(HttpState state, HttpConnection conn)
throws IOException, HttpRecoverableException, HttpException {
...
//read out the HTTP status string
String s = conn.readLine();
while ((s != null) && !StatusLine.startsWithHTTP(s)) {
if (Wire.enabled()) {
Wire.input(s + "\r\n");
}
s = conn.readLine();
}
if (s == null) {
// A null statusString means the connection was lost before we got a
// response.  Try again.
throw new HttpRecoverableException("Error in parsing the status "
+ " line from the response: unable to find line starting with"
+ " \"HTTP\"");
}
==

"Unable to find line starting with HTTP" exception is thrown ONLY if end of
stream (EOF) condition is encountered. That is, the server explicitly closes the
outstream stream on unsuspecting HttpClient. Unless I am missing something,
socket timeout _should_ never be able to cause EOF on the input stream, and
subsequently cause the misleading error message.

Important piece of the puzzle, however, is SSL. We have seen SSL sockets behave
very funny with regards to EOF condition and socket timeouts. That is why
100-continue detection does not work, by the way. The problems with SSL tend to
be highly JRE specific. What JDK/JRE are you using?

Oleg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 28354] - unable to find line starting with "HTTP" message when timeout occurs

2004-04-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=28354

unable to find line starting with "HTTP" message when timeout occurs





--- Additional Comments From [EMAIL PROTECTED]  2004-04-13 04:16 ---
Hi Oleg,

You are right - "the problem is in fact caused by the server dropping 
connection" (maybe not the server but the HTTP commons-client, what is ok and 
expected as the timeout is reached). The problem occurs with HTTP commons-
client RC2 and final releases.

A more detailed description:

I seem to get a response code 100 (continue) that's why you can see:

"...HttpMethodBase  - Discarding unexpected response: HTTP/1.1 100 Continue"
(When I use Plain SSL Sockets I do not get this code. I always get the 200 SC.)

The problem is that after the timeout is reached and the server is still 
processing the request, the exception is thrown. From my point of view, 
the "real bug" is the exception message that should indicate that the timeout 
period was reached while awaiting for data and not "there were a problem while 
parsing the HTTP line from the response". From the JavaDoc, the method 
HttpClient.setTimeout says that "it's the timeout for waiting for data" but if 
no data was sent by the target server until the timeout was reached, it should 
warn properly.

Maybe a way to simulate the problem is to create a JSP page that keeps 
processing a long time (Thread.sleep) and we make the request to this JSP 
invoking HttpClient.setTimeout with a low value. This way I think we will be 
able to simulate the problem.

It's too late here (Brazil). Tomorrow morning I'll try to work in a way to 
simulate the problem with the JSP approach.

Thanks a lot for the quick response!
Daniel

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 28354] - unable to find line starting with "HTTP" message when timeout occurs

2004-04-12 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
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=28354

unable to find line starting with "HTTP" message when timeout occurs





--- Additional Comments From [EMAIL PROTECTED]  2004-04-12 21:57 ---
Daniel,
I seem unable to reproduce the problem. if I set socket timeout to a
ridiculously small value, this is what I get:

[DEBUG] HttpConnection - -HttpConnection.setSoTimeout(1)
[DEBUG] HttpMethodBase - -Execute loop try 1
[DEBUG] HttpMethodBase - -Adding Host request header
[DEBUG] HttpMethodBase - -Closing the connection.
[INFO] HttpMethodBase - -Recoverable exception caught when processing request
[WARN] HttpMethodBase - -Recoverable exception caught but
MethodRetryHandler.retryMethod() returned false, rethrowing exception
Exception in thread "main"
org.apache.commons.httpclient.HttpRecoverableException:
java.io.InterruptedIOException: Read timed out
at
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1933)
at
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2627)
at 
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1061)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:643)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:497)
at Test.main(Test.java:27)

It does seem that the problem is in fact caused by the server dropping
connection before sending a status line, not a timeout. Am I missing something?

You are using 2.0-final, right?

Oleg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]