mirror of https://github.com/n1nj4sec/pupy.git
Delay is small, we use separate thread..
This commit is contained in:
parent
ab9825fa28
commit
577f53dc9b
|
@ -6,9 +6,6 @@ transport protocol is available here:
|
||||||
http://www.cs.kau.se/philwint/scramblesuit/
|
http://www.cs.kau.se/philwint/scramblesuit/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#from twisted.internet import reactor
|
|
||||||
from ..obfscommon import threads as reactor
|
|
||||||
|
|
||||||
from ... import base
|
from ... import base
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -26,6 +23,7 @@ import uniformdh
|
||||||
import state
|
import state
|
||||||
import fifobuf
|
import fifobuf
|
||||||
import ticket
|
import ticket
|
||||||
|
import time
|
||||||
|
|
||||||
log = logging
|
log = logging
|
||||||
|
|
||||||
|
@ -34,7 +32,6 @@ class ReadPassFile(argparse.Action):
|
||||||
with open(values) as f:
|
with open(values) as f:
|
||||||
setattr(namespace, self.dest, f.readline().strip())
|
setattr(namespace, self.dest, f.readline().strip())
|
||||||
|
|
||||||
|
|
||||||
class ScrambleSuitTransport( base.BaseTransport ):
|
class ScrambleSuitTransport( base.BaseTransport ):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -252,8 +249,8 @@ class ScrambleSuitTransport( base.BaseTransport ):
|
||||||
|
|
||||||
if len(self.choppingBuf) == 0:
|
if len(self.choppingBuf) == 0:
|
||||||
self.choppingBuf.write(blurb)
|
self.choppingBuf.write(blurb)
|
||||||
reactor.callLater(self.iatMorpher.randomSample(),
|
time.sleep(self.iatMorpher.randomSample())
|
||||||
self.flushPieces)
|
self.flushPieces()
|
||||||
else:
|
else:
|
||||||
# flushPieces() is still busy processing the chopping buffer.
|
# flushPieces() is still busy processing the chopping buffer.
|
||||||
self.choppingBuf.write(blurb)
|
self.choppingBuf.write(blurb)
|
||||||
|
@ -289,7 +286,8 @@ class ScrambleSuitTransport( base.BaseTransport ):
|
||||||
self.circuit.downstream.write(blurb + padBlurb)
|
self.circuit.downstream.write(blurb + padBlurb)
|
||||||
return
|
return
|
||||||
|
|
||||||
reactor.callLater(self.iatMorpher.randomSample(), self.flushPieces)
|
time.sleep(self.iatMorpher.randomSample())
|
||||||
|
self.flushPieces
|
||||||
|
|
||||||
def processMessages( self, data ):
|
def processMessages( self, data ):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue