move server logic into its own class
This commit is contained in:
parent
3c159a5729
commit
cf6fd727a5
3
esgd.py
3
esgd.py
|
@ -51,7 +51,7 @@ class GopherLine:
|
|||
self.port
|
||||
)
|
||||
|
||||
class gopherHandler(socketserver.BaseRequestHandler):
|
||||
class GopherServerLogic:
|
||||
def recieveRequest(self):
|
||||
data = b""
|
||||
while data[-2:] != b"\r\n":
|
||||
|
@ -140,6 +140,7 @@ class gopherHandler(socketserver.BaseRequestHandler):
|
|||
if gph: fa = self.gopherRenderer(fa)
|
||||
self.sendFileArray(fa)
|
||||
|
||||
class gopherHandler(socketserver.BaseRequestHandler, GopherServerLogic):
|
||||
def handle(self):
|
||||
decoded = self.recieveRequest()
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue