summaryrefslogtreecommitdiffstats
path: root/src/ogClient.py
diff options
context:
space:
mode:
authorAlvaro Neira Ayuso <aneira@soleta.eu>2019-12-12 15:53:38 +0100
committerAlvaro Neira Ayuso <alvaroneay@gmail.com>2020-01-19 19:50:44 +0100
commitebd640a9c5d308c0ba115fea6c8cc0666010eab6 (patch)
tree62cd0994d373005755df84fa4f539d870cef8fad /src/ogClient.py
parentbfdeae840c95fb9da504af795179be65c6286326 (diff)
Add ogProcess and ogOperation for linux
Thoses new classes allows us to process and execute commands from server side sent using HTTP format.
Diffstat (limited to 'src/ogClient.py')
-rw-r--r--src/ogClient.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ogClient.py b/src/ogClient.py
index b54d736..2c57730 100644
--- a/src/ogClient.py
+++ b/src/ogClient.py
@@ -4,6 +4,7 @@ import socket
import time
from HTTPParser import *
+from ogProcess import *
from enum import Enum
class State(Enum):
@@ -67,6 +68,7 @@ class ogClient:
self.data = self.data + data
httpparser = HTTPParser()
+ ogprocess = ogProcess()
if not self.trailer:
if self.data.find("\r\n") > 0:
@@ -81,6 +83,9 @@ class ogClient:
if self.trailer and len(self.data) >= self.content_len:
httpparser.parser(self.data)
+ print httpparser.getRequestOP()
+ print httpparser.getURI()
+ ogprocess.processOperation(httpparser.getRequestOP(), httpparser.getURI())
self.sock.send("HTTP/1.0 200 OK\r\n\r\n")