tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kees Jan Koster <kjkos...@kjkoster.org>
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

http://java-monitor.com/forum/
kjkoster@kjkoster.org
06-51838192

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


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message