Hello Adam,
I didn'tt reproduce your problem.
Here is the requests/response headers as shown with the
LiveHttpHeaders extension, could you send yours?
**************************
http://localhost:8182/
POST / HTTP/1.1
Host: localhost:8182
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4)
Gecko/20070515 Firefox/2.0.0.4
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: fr,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-15,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: session=AQYFYMMYWCONXQUKCDWG
Content-Type: application/x-www-form-urlencoded
Content-Length: 7
foo=bar
HTTP/1.x 200 The request has succeeded
Date: Tue, 05 Jun 2007 17:32:26 GMT
Server:
Noelios-Restlet-Engine/@[EMAIL PROTECTED]@[EMAIL PROTECTED]@release-number@
Content-Type: text/plain; charset=ISO-8859-1
Content-Length: 11
**************************
best regards,
Thierry Boileau
I've discovered a problem with the Simple framework web server in
conjunction with Keep Alive. Basically, it seems triggered by two
POST requests in a row. The first POST request works fine, however
a followup POST request will hang. Once a certain time has passed
(in Firefox I believe it's 30 seconds), another POST request will go
through.
Once a POST has been made, then any other request will timeout
including GET requests, etc. After the timeout expires, all
requests will work again. Also (possibly related, but not sure),
I'm getting some connection resets when performing multiple GET
operations quickly in a row (simply by clicking the refresh button
on the browser).
I'm wondering if this is related to bug #313. It seems very
similar. Is bug #313 using the Simple web server??
By disabling Keep Alive in my browser (Firefox - about:config), the
problem completely goes away. It's obvious that the keep alive
handling is problematic.
I've switched to the Async web server to run my tests and don't have
any of the above described problems. So, that's why I'm confident
it's likely in the Simple helper classes.
I'll plan on filing a bug report, but I wanted to see if this issue
was known about before I did. I can't see any bug like it, but
thought I'd check on the mailing list first. I'm hopeful that this
issue will help whomever is being hung up on bug #313 as well.
Here's the restlet I'm using for testing purposes. Again, to see
the difference, be sure to use a browser which you can disable keep
alive, like Firefox.
public class RestletTest {
private static int count = 1;
public static void main(String[] args) throws Exception {
Restlet restlet = new Restlet() {
@Override
public void handle(Request request, Response response) {
response.setEntity("Request #" + (count++), MediaType.TEXT_PLAIN);
}
};
new Server(Protocol.HTTP, 8182, restlet).start();
}
}
Here's an HTML file which you can use to post to the above servlet.
<html>
<body>
<form action="http://localhost:8182/" method="POST">
<input type="hidden" name="foo" value="bar" />
<input type="submit" />
</form>
</body>
</html>
Thanks,
Adam