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:
java.lang.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.


Nested Class Summary
 
Nested classes/interfaces inherited from class net.i2p.util.I2PThread
I2PThread.OOMEventListener
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class net.i2p.i2ptunnel.I2PTunnelRunner
finished, finishLock, initialI2PData, initialSocketData, MAX_PACKET_SIZE, NETWORK_BUFFER_SIZE, ostreams, slock, sockets
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
I2PTunnelHTTPClientRunner(java.net.Socket s, I2PSocket i2ps, java.lang.Object slock, byte[] initialI2PData, java.util.List sockList, java.lang.Runnable onTimeout)
           
 
Method Summary
protected  void close(java.io.OutputStream out, java.io.InputStream in, java.io.OutputStream i2pout, java.io.InputStream i2pin, java.net.Socket s, I2PSocket i2ps, java.lang.Thread t1, java.lang.Thread t2)
           
protected  java.io.OutputStream getSocketOut()
           
 
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, finalize, main, removeOOMEventListener
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

I2PTunnelHTTPClientRunner

public I2PTunnelHTTPClientRunner(java.net.Socket s,
                                 I2PSocket i2ps,
                                 java.lang.Object slock,
                                 byte[] initialI2PData,
                                 java.util.List sockList,
                                 java.lang.Runnable onTimeout)
Method Detail

getSocketOut

protected java.io.OutputStream getSocketOut()
                                     throws java.io.IOException
Overrides:
getSocketOut in class I2PTunnelRunner
Throws:
java.io.IOException

close

protected void close(java.io.OutputStream out,
                     java.io.InputStream in,
                     java.io.OutputStream i2pout,
                     java.io.InputStream i2pin,
                     java.net.Socket s,
                     I2PSocket i2ps,
                     java.lang.Thread t1,
                     java.lang.Thread t2)
              throws java.lang.InterruptedException,
                     java.io.IOException
Overrides:
close in class I2PTunnelRunner
Throws:
java.lang.InterruptedException
java.io.IOException