net.i2p.i2ptunnel
Class I2PTunnelHTTPClientRunner

java.lang.Object
  extended by java.lang.Thread
      extended by net.i2p.util.I2PThread
          extended by net.i2p.util.I2PAppThread
              extended by net.i2p.i2ptunnel.I2PTunnelRunner
                  extended by net.i2p.i2ptunnel.I2PTunnelHTTPClientRunner
All Implemented Interfaces:
Runnable, I2PSocket.SocketErrorListener

public class I2PTunnelHTTPClientRunner
extends I2PTunnelRunner

Override the response with a stream filtering the HTTP headers received. Specifically, this makes sure we get Connection: close, so the browser knows they really shouldn't try to use persistent connections. The HTTP server *should* already be setting this, since the HTTP headers sent by the browser specify Connection: close, and the server should echo it. However, both broken and malicious servers could ignore that, potentially confusing the user. Warning - not maintained as a stable API for external use.


Nested Class Summary
 
Nested classes/interfaces inherited from class net.i2p.i2ptunnel.I2PTunnelRunner
I2PTunnelRunner.FailCallback
 
Nested classes/interfaces inherited from class net.i2p.util.I2PThread
I2PThread.OOMEventListener
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class net.i2p.i2ptunnel.I2PTunnelRunner
_log, MAX_PACKET_SIZE, NETWORK_BUFFER_SIZE
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
I2PTunnelHTTPClientRunner(Socket s, I2PSocket i2ps, Object slock, byte[] initialI2PData, List<I2PSocket> sockList, I2PTunnelRunner.FailCallback onFail)
          Does NOT start itself.
 
Method Summary
protected  void close(OutputStream out, InputStream in, OutputStream i2pout, InputStream i2pin, Socket s, I2PSocket i2ps, Thread t1, Thread t2)
          Why is this overridden? Why flush in super but not here? Why do things in different order than in super?
protected  OutputStream getSocketOut()
          Only call once!
 
Methods inherited from class net.i2p.i2ptunnel.I2PTunnelRunner
errorOccurred, getLastActivityOn, getSocketIn, getStartedOn, isFinished, run
 
Methods inherited from class net.i2p.util.I2PAppThread
addOOMEventThreadListener, fireOOM, removeOOMEventThreadListener
 
Methods inherited from class net.i2p.util.I2PThread
addOOMEventListener, removeOOMEventListener, start
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

I2PTunnelHTTPClientRunner

public I2PTunnelHTTPClientRunner(Socket s,
                                 I2PSocket i2ps,
                                 Object slock,
                                 byte[] initialI2PData,
                                 List<I2PSocket> sockList,
                                 I2PTunnelRunner.FailCallback onFail)
Does NOT start itself. Caller must call start().

Method Detail

getSocketOut

protected OutputStream getSocketOut()
                             throws IOException
Only call once!

Overrides:
getSocketOut in class I2PTunnelRunner
Throws:
IOException

close

protected void close(OutputStream out,
                     InputStream in,
                     OutputStream i2pout,
                     InputStream i2pin,
                     Socket s,
                     I2PSocket i2ps,
                     Thread t1,
                     Thread t2)
              throws InterruptedException
Why is this overridden? Why flush in super but not here? Why do things in different order than in super?

Overrides:
close in class I2PTunnelRunner
Throws:
InterruptedException