Salut Nicolas,

Thanks for reporting this with a test case. 

We initially only implemented this feature on the internal HTTP connector.
After a bit of refactoring I extended this to other connectors, including
Simple. Changes are in SVN trunk. Note that the method actually closes the
underlying socket without any special care. 

Also, 2.0 M7 has been added to the issue tracker. Thanks for pointing that
as well.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Technical Lead ~ http://www.restlet.org
Noelios Technologies ~ http://www.noelios.com



-----Message d'origine-----
De : Nicolas Rinaudo [mailto:[email protected]] 
Envoyé : mardi 2 février 2010 15:27
À : [email protected]
Objet : Cancelling request entity

Hey,

If my understanding is correct, Request.abort() allows server resources to
not read a request entity that they know won't be accepted - unacceptable
MIME type, too large...

I have however been incapable of getting this to work. Attached is a sample
case, which should be compiled and run against Restlet 2.0m7.

What it does is:
- create a simple server resource that only accepts POST and immediately
calls getRequest().abort();
- submit a "counting" input stream to that resource: the stream will count
the number of bytes that it returns.
- print the number of bytes that the server resource has read.

This number is always the size of the submitted stream, which seems to
defeat the purpose of Request.abort().

I might very well have misunderstood the purpose of the abort() method, or
be doing something wrong. Can anyone point me in the right direction ?

For reference, I'm running these tests:
- with Restlet 2.0m7.
- using org.restlet.ext.simple for the server connector.

Oh, and as a side note, Restlet 2.0m7 isn't yet available in the issue
tracker's versions.

Cheers,
Nicolas

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2452464

Reply via email to