tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kees Jan Koster <>
Subject Re: override 100-continue response in servlet
Date Sun, 24 Aug 2008 20:37:00 GMT
Dear Craig,

> I'm writing a servlet to allow large-file uploads (with ranges and  
> resume). One issue I noticed was that if the range is invalid (I do  
> the checks in doPut), and I return a 416, the client (curl in this  
> case) continues to upload the body (possibly gigabytes of data that  
> will be discarded) because tomcat already sent the 100-continue.

Ah. Rebuilding FTP? :-)

> Maybe I could just force the connection to close somehow, but I'd  
> like to respond with the 416 instead of tomcat's immediate 100- 
> continue. Is there a way to override the 100-continue behaviour so I  
> can perform the checks and return 100 or 416 myself?

You could use a servlet-filter to do the checks earlier? Other that  
that, you're looking at hacking Tomcat itself.

> If not, how could I force the connection to close immediately?

response.getOutputStream().close() ?
Kees Jan

The secret of success lies in the stability of the goal. -- Benjamin  

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message