Sanitize send()ed stuff
This commit is contained in:
parent
ddc026907a
commit
e2f90554b0
|
@ -53,6 +53,7 @@ class Connhandler(threading.Thread):
|
||||||
self.inpc=inpc
|
self.inpc=inpc
|
||||||
self.logc=logc
|
self.logc=logc
|
||||||
def send(self,s):
|
def send(self,s):
|
||||||
|
s=s.replace('\n','\\n').replace('\r','\\r') # Sanitize output
|
||||||
if len(s)>512: s=s[:512]
|
if len(s)>512: s=s[:512]
|
||||||
self.sock.send(s+'\r\n')
|
self.sock.send(s+'\r\n')
|
||||||
if s.split(' ')[0]!='PONG':
|
if s.split(' ')[0]!='PONG':
|
||||||
|
|
Loading…
Reference in New Issue