Changeset b5ed39f1
- Timestamp:
- Jul 28, 2018 9:44:56 PM (2 years ago)
- Branches:
- master
- Children:
- a51d260
- Parents:
- f12dbba
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketOptions.java
rf12dbba rb5ed39f1 38 38 * What is the longest we'll block on the input stream while waiting 39 39 * for more data. If this value is exceeded, the read() throws 40 * InterruptedIOException - FIXME doesn't really, returns -1 or 0 instead. 40 * SocketTimeoutException as of 0.9.36. 41 * Prior to that, the read() returned -1 or 0. 41 42 * 42 43 * WARNING: Default -1 (unlimited), which is probably not what you want. … … 49 50 * What is the longest we'll block on the input stream while waiting 50 51 * for more data. If this value is exceeded, the read() throws 51 * InterruptedIOException - FIXME doesn't really, returns -1 or 0 instead. 52 * SocketTimeoutException as of 0.9.36. 53 * Prior to that, the read() returned -1 or 0. 52 54 * 53 55 * WARNING: Default -1 (unlimited), which is probably not what you want. -
apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketOptionsImpl.java
rf12dbba rb5ed39f1 145 145 * What is the longest we'll block on the input stream while waiting 146 146 * for more data. If this value is exceeded, the read() throws 147 * InterruptedIOException - FIXME doesn't really, returns -1 or 0 instead. 147 * SocketTimeoutException as of 0.9.36. 148 * Prior to that, the read() returned -1 or 0. 148 149 * 149 150 * WARNING: Default -1 (unlimited), which is probably not what you want. … … 158 159 * What is the longest we'll block on the input stream while waiting 159 160 * for more data. If this value is exceeded, the read() throws 160 * InterruptedIOException - FIXME doesn't really, returns -1 or 0 instead. 161 * SocketTimeoutException as of 0.9.36. 162 * Prior to that, the read() returned -1 or 0. 161 163 * 162 164 * WARNING: Default -1 (unlimited), which is probably not what you want. -
apps/streaming/java/src/net/i2p/client/streaming/impl/MessageInputStream.java
rf12dbba rb5ed39f1 4 4 import java.io.InputStream; 5 5 import java.io.InterruptedIOException; 6 import java.net.SocketTimeoutException; 6 7 import java.util.ArrayList; 7 8 import java.util.HashMap; … … 353 354 _highestReadyBlockId++; 354 355 } 355 // FIXME Javadocs for setReadTimeout() say we will throw356 // an InterruptedIOException.357 // Java throws a SocketTimeoutException.358 // We do neither.359 356 } else { 360 357 // _notYetReadyBlocks size is limited in canAccept() … … 376 373 377 374 /** 378 * On a read timeout, this returns -1 379 * (doesn't throw SocketTimeoutException like Socket) 380 * (doesn't throw InterruptedIOException like our javadocs say) 375 * On a read timeout, this throws a SocketTimeoutException 376 * as of 0.9.36. Prior to that, returned -1. 381 377 */ 382 378 public int read() throws IOException { … … 388 384 389 385 /** 390 * On a read timeout, this returns 0 391 * (doesn't throw SocketTimeoutException like Socket) 392 * (doesn't throw InterruptedIOException like our javadocs say) 386 * On a read timeout, this throws a SocketTimeoutException 387 * as of 0.9.36. Prior to that, returned 0. 393 388 */ 394 389 @Override … … 398 393 399 394 /** 400 * On a read timeout, this returns 0 401 * (doesn't throw SocketTimeoutException like Socket) 402 * (doesn't throw InterruptedIOException like our javadocs say) 395 * On a read timeout, this throws a SocketTimeoutException 396 * as of 0.9.36. Prior to that, returned 0. 403 397 */ 404 398 @Override … … 410 404 else 411 405 expiration = -1; 406 // for speed 407 final boolean shouldDebug = _log.shouldDebug(); 412 408 synchronized (_dataLock) { 413 409 if (_locallyClosed) throw new IOException("Input stream closed"); … … 425 421 if (_log.shouldLog(Log.INFO)) 426 422 _log.info("read(...," + offset + ", " + length + ")[" + i 427 + "] got EOF after " + _readTotal + " " + toString());423 + "] got EOF after " + _readTotal + ": " + hashCode()); 428 424 return -1; 429 425 } else { 430 426 if (readTimeout < 0) { 431 if ( _log.shouldLog(Log.DEBUG))427 if (shouldDebug) 432 428 _log.debug("read(...," + offset+", " + length+ ")[" + i 433 + "] w ith no timeout: " + toString());429 + "] wait w/o timeout: " + hashCode()); 434 430 try { 435 431 _dataLock.wait(); … … 439 435 throw ioe2; 440 436 } 441 if ( _log.shouldLog(Log.DEBUG))437 if (shouldDebug) 442 438 _log.debug("read(...," + offset+", " + length+ ")[" + i 443 + "] w ith no timeout complete: " + toString());439 + "] wait w/o timeout complete: " + hashCode()); 444 440 throwAnyError(); 445 441 } else if (readTimeout > 0) { 446 if ( _log.shouldLog(Log.DEBUG))442 if (shouldDebug) 447 443 _log.debug("read(...," + offset+", " + length+ ")[" + i 448 + "] w ith timeout: " + readTimeout + ": " + toString());444 + "] wait: " + readTimeout + ": " + hashCode()); 449 445 try { 450 446 _dataLock.wait(readTimeout); … … 454 450 throw ioe2; 455 451 } 456 if ( _log.shouldLog(Log.DEBUG))452 if (shouldDebug) 457 453 _log.debug("read(...," + offset+", " + length+ ")[" + i 458 + "] w ith timeout complete: " + readTimeout + ": " + toString());454 + "] wait complete: " + readTimeout + ": " + hashCode()); 459 455 throwAnyError(); 460 456 } else { // readTimeout == 0 461 457 // noop, don't block 462 if ( _log.shouldLog(Log.DEBUG))458 if (shouldDebug) 463 459 _log.debug("read(...," + offset+", " + length+ ")[" + i 464 + "] with nonblocking setup: " + toString());465 return i;460 + "] nonblocking return: " + hashCode()); 461 return 0; 466 462 } 467 463 if (_readyDataBlocks.isEmpty()) { … … 469 465 long remaining = expiration - System.currentTimeMillis(); 470 466 if (remaining <= 0) { 471 // FIXME Javadocs for setReadTimeout() say we will throw472 // an InterruptedIOException.473 // Java throws a SocketTimeoutException.474 // We do neither.475 467 if (_log.shouldLog(Log.INFO)) 476 468 _log.info("read(...," + offset+", " + length+ ")[" + i 477 + "] expired: " + toString());478 return i;469 + "] timed out: " + hashCode()); 470 throw new SocketTimeoutException(); 479 471 } else { 480 472 readTimeout = (int) remaining; … … 487 479 i--; 488 480 } else if (_readyDataBlocks.isEmpty()) { 489 if ( _log.shouldLog(Log.DEBUG))481 if (shouldDebug) 490 482 _log.debug("read(...," + offset+", " + length+ ")[" + i 491 483 + "] no more ready blocks, returning"); … … 503 495 target[offset + i] = rv; // rv < 0 ? rv + 256 : rv 504 496 if ( (_readyDataBlockIndex <= 3) || (_readyDataBlockIndex >= cur.getValid() - 5) ) { 505 if ( _log.shouldLog(Log.DEBUG))497 if (shouldDebug) 506 498 _log.debug("read(...," + offset+", " + length+ ")[" + i 507 499 + "] after ready data: readyDataBlockIndex=" + _readyDataBlockIndex … … 515 507 } // synchronized (_dataLock) 516 508 517 if ( _log.shouldLog(Log.DEBUG))509 if (shouldDebug) 518 510 _log.debug("read(byte[]," + offset + ',' + length + ") read fully; total read: " +_readTotal); 519 511 -
history.txt
rf12dbba rb5ed39f1 1 2018-07-28 zzz 2 * Console: Catch ISE in get/setAttribute() (ticket #1529) 3 * Streaming: Throw exception on read timeout (ticket #2292) 4 1 5 2018-07-27 zzz 2 6 * Console: Split netdb output into pages -
router/java/src/net/i2p/router/RouterVersion.java
rf12dbba rb5ed39f1 19 19 public final static String ID = "Monotone"; 20 20 public final static String VERSION = CoreVersion.VERSION; 21 public final static long BUILD = 1 8;21 public final static long BUILD = 19; 22 22 23 23 /** for example "-test" */
Note: See TracChangeset
for help on using the changeset viewer.