* HTTPClient: Fix error page not appearing, broken by

StreamForwarder change
This commit is contained in:
zzz
2011-09-24 21:49:19 +00:00
parent ce5acb490a
commit cc7a8028d1
3 changed files with 15 additions and 3 deletions

View File

@ -76,7 +76,8 @@ public class I2PTunnelRunner extends I2PAppThread implements I2PSocket.SocketErr
* @param initialSocketData may be null * @param initialSocketData may be null
* @param sockList may be null. Caller must add i2ps to the list! It will be removed here on completion. * @param sockList may be null. Caller must add i2ps to the list! It will be removed here on completion.
* Will synchronize on slock when removing. * Will synchronize on slock when removing.
* @param onTimeout may be null * @param onTimeout May be null. If non-null and no data (except initial data) was sent or received,
it will be run before closing s.
*/ */
public I2PTunnelRunner(Socket s, I2PSocket i2ps, Object slock, byte[] initialI2PData, public I2PTunnelRunner(Socket s, I2PSocket i2ps, Object slock, byte[] initialI2PData,
byte[] initialSocketData, List<I2PSocket> sockList, Runnable onTimeout) { byte[] initialSocketData, List<I2PSocket> sockList, Runnable onTimeout) {
@ -384,7 +385,13 @@ public class I2PTunnelRunner extends I2PAppThread implements I2PSocket.SocketErr
// or else input end gives up and we have data loss. // or else input end gives up and we have data loss.
// http://techtavern.wordpress.com/2008/07/16/whats-this-ioexception-write-end-dead/ // http://techtavern.wordpress.com/2008/07/16/whats-this-ioexception-write-end-dead/
//out.flush(); //out.flush();
out.close(); // DON'T close if we have a timeout job and we haven't received anything,
// or else the timeout job can't write the error message to the stream.
// close() above will close it after the timeout job is run.
if (!(onTimeout != null && (!_toI2P) && totalReceived <= 0))
out.close();
else if (_log.shouldLog(Log.INFO))
_log.info(direction + ": not closing so we can write the error message");
} catch (IOException ioe) { } catch (IOException ioe) {
if (_log.shouldLog(Log.WARN)) if (_log.shouldLog(Log.WARN))
_log.warn(direction + ": Error flushing to close", ioe); _log.warn(direction + ": Error flushing to close", ioe);

View File

@ -1,3 +1,8 @@
2011-09-24 zzz
* HTTPClient: Fix error page not appearing, broken by
StreamForwarder change
* HTTPServer: More mime types not to compress
2011-09-23 kytv 2011-09-23 kytv
* Update Italian, Spanish, and Swedish translations * Update Italian, Spanish, and Swedish translations
from Transifex from Transifex

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 20; public final static long BUILD = 21;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";