Hello Alex,

Thanks for reporting this issue, which has been fixed in the SVN repository.
This issue happens when the Net client connector is used in conjunction with the Jetty server connector. The Jetty HTTP implementation throws an exception when the request size exceeds the headerBufferSize parameter and thus breaks the communication with the client.
This cannot be trapped by the Restlet framework.
On the client side, there was a bug with the Net client extension that detected correctly the end of the communication, but returned a -1 status code. Now, the generic status code 1001 (CONNECTOR_ERROR_COMMUNICATION) is returned instead. As you may notice, this is not a standard HTTP status code because there is no way to determine the real cause of error, and no status code has been returned by the server.


Best regards,
Thierry Boileau


The way I got the bug was as follows:

String request = "http://localhost:1234/";;
for(int i=0;i<5*1024;i++)
    request += "a";

Component component = new Component();
Server server = component.getServers().add(Protocol.HTTP, 1234);
component.start();

Client client = new Client(Protocol.HTTP);
Response response = client.get(request);

response.getStatus() will be equal to "null (-1)"

However, if you insert:
server.getContext().getParameters().set("headerBufferSize", "6144", false);
before component.start(), then response.getStatus() will be 404, as expected.


Reply via email to