fakeftp: nur IPv4
This commit is contained in:
parent
1d47a69361
commit
7bad267652
1 changed files with 5 additions and 3 deletions
|
@ -4,6 +4,8 @@ import socket
|
||||||
from random import randint
|
from random import randint
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
SocketServer.ThreadingTCPServer.address_family = socket.AF_INET
|
||||||
|
|
||||||
class Utils:
|
class Utils:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def mask(rights):
|
def mask(rights):
|
||||||
|
@ -605,7 +607,7 @@ class State:
|
||||||
except Exception:
|
except Exception:
|
||||||
handler.send( FatalServerErrorMessage() )
|
handler.send( FatalServerErrorMessage() )
|
||||||
handler.running = False
|
handler.running = False
|
||||||
|
|
||||||
|
|
||||||
class BaseState(State):
|
class BaseState(State):
|
||||||
handlers = [ QuitCommandHandler(), NoOperationCommandHandler() ]
|
handlers = [ QuitCommandHandler(), NoOperationCommandHandler() ]
|
||||||
|
@ -784,10 +786,10 @@ handler.rootDirectory = Directory("",files=[
|
||||||
File("initrd.img",size=4000000)
|
File("initrd.img",size=4000000)
|
||||||
])
|
])
|
||||||
|
|
||||||
port = 1234
|
port = 21
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
server = SocketServer.ThreadingTCPServer(("",port),handler)
|
server = SocketServer.ThreadingTCPServer(("0.0.0.0",port),handler)
|
||||||
print "Listening on port %d" % port
|
print "Listening on port %d" % port
|
||||||
server.serve_forever()
|
server.serve_forever()
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue