Merge pull request #92 from Crypt0-M3lon/master

Fix socket timeout on HTTP POST requests
This commit is contained in:
lgandx 2019-05-26 11:04:48 -03:00 committed by GitHub
commit e1d1657dff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -278,8 +278,6 @@ class HTTP(BaseRequestHandler):
break break
data += buff data += buff
remaining -= len(buff) remaining -= len(buff)
if remaining <= 0:
break
#check if we recieved the full header #check if we recieved the full header
if data.find('\r\n\r\n') != -1: if data.find('\r\n\r\n') != -1:
#we did, now to check if there was anything else in the request besides the header #we did, now to check if there was anything else in the request besides the header
@ -292,7 +290,8 @@ class HTTP(BaseRequestHandler):
if line.find('Content-Length') != -1: if line.find('Content-Length') != -1:
line = line.strip() line = line.strip()
remaining = int(line.split(':')[1].strip()) - len(data) remaining = int(line.split(':')[1].strip()) - len(data)
if remaining <= 0:
break
if data == "": if data == "":
break break
#now the data variable has the full request #now the data variable has the full request