Streaming read timeout fixes:

i2ptunnel:
- Better timeout handling when reading headers in HTTP server (improved fix for ticket #723)
  Enforce total header timeout with new readLine()
- Prep for returning specific HTTP errors to client on request timeout and header errors,
  instead of just closing socket... further work to be in i2p.i2p.zzz.test2 branch
Streaming:
- Fix read timeout on input stream - was waiting too long, often twice as long as timeout, or more
  Enforce total timeout even when notify()ed
- Fix read() returning 0 on read timeout instead of -1 (possible fix for ticket #335)
  This prevents passing partial headers to server on timeout
- Fix javadocs for read timeout to match current behavior
- Fix StandardSocket SoTimeout to account for differences with I2PSocket readTimeout
- log tweaks
This commit is contained in:
zzz
2015-04-04 17:00:57 +00:00
parent 351a1a8d27
commit 706ee243a5
8 changed files with 181 additions and 38 deletions

View File

@@ -37,22 +37,22 @@ public interface I2PSocketOptions {
/**
* What is the longest we'll block on the input stream while waiting
* for more data. If this value is exceeded, the read() throws
* InterruptedIOException
* InterruptedIOException - FIXME doesn't really, returns -1 or 0 instead.
*
* WARNING: Default -1 (unlimited), which is probably not what you want.
*
* @return timeout in ms
* @return timeout in ms, 0 for nonblocking, -1 for forever
*/
public long getReadTimeout();
/**
* What is the longest we'll block on the input stream while waiting
* for more data. If this value is exceeded, the read() throws
* InterruptedIOException
* InterruptedIOException - FIXME doesn't really, returns -1 or 0 instead.
*
* WARNING: Default -1 (unlimited), which is probably not what you want.
*
* @param ms timeout in ms
* @param ms timeout in ms, 0 for nonblocking, -1 for forever
*/
public void setReadTimeout(long ms);