def __init__(self, cl, req, resp):
super().__init__(cl, req, resp, 'RC')
ssddesc = '[%s] %s' % (id(req), self._desc)
- self._ssd = SlipStreamDecoder(ssddesc, partial(queue_inbound, cl.ipif))
+ self._ssd = SlipStreamDecoder(ssddesc, partial(queue_inbound, cl.ipif),
+ cl.c.mtu)
self._log(DBG.HTTP_CTRL, '__init__')
def dataReceived(self, data):
for cl in clients:
cl.start()
- cl.ipif = start_ipif(cl.c.ipif_command, cl.outbound)
+ cl.ipif = start_ipif(cl.c.ipif_command, cl.outbound, cl.c.mtu)
cl.check_outbound()
common_run()
catch_termination()
start_http()
daemonise()
-ipif = start_ipif(c.ipif_command, (lambda p,s,d: route(p,"[ipif]",s,d)))
+ipif = start_ipif(c.ipif_command,
+ (lambda p,s,d: route(p,"[ipif]",s,d)),
+ c.mtu)
common_run()
#---------- ipif (SLIP) subprocess ----------
class SlipStreamDecoder():
- def __init__(self, desc, on_packet):
+ def __init__(self, desc, on_packet, mtu):
self._buffer = b''
self._on_packet = on_packet
self._desc = desc
self._maybe_packet(packets[0])
class _IpifProcessProtocol(twisted.internet.protocol.ProcessProtocol):
- def __init__(self, router):
+ def __init__(self, router, mtu):
self._router = router
- self._decoder = SlipStreamDecoder('ipif', self.slip_on_packet)
+ self._decoder = SlipStreamDecoder('ipif', self.slip_on_packet, mtu)
def connectionMade(self): pass
def outReceived(self, data):
self._decoder.inputdata(data)
def processEnded(self, status):
status.raiseException()
-def start_ipif(command, router):
- ipif = _IpifProcessProtocol(router)
+def start_ipif(command, router, mtu):
+ ipif = _IpifProcessProtocol(router, mtu)
reactor.spawnProcess(ipif,
'/bin/sh',['sh','-xc', command],
childFDs={0:'w', 1:'r', 2:2},