move server logic into its own class

This commit is contained in:
randomuser 2021-07-20 02:40:48 -05:00
parent 3c159a5729
commit cf6fd727a5
1 changed files with 2 additions and 1 deletions

View File

@ -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: