Skip to content

Instantly share code, notes, and snippets.

@dpgoetz
Created May 15, 2017 17:57
Show Gist options
  • Save dpgoetz/a17156411b5bebd394cb0f677446c640 to your computer and use it in GitHub Desktop.
Save dpgoetz/a17156411b5bebd394cb0f677446c640 to your computer and use it in GitHub Desktop.
dfg@saio4:~/hbird-tests$ cat slo-read.py
import httplib
import time
for i in range(30):
c = httplib.HTTPConnection("127.0.0.1:8080")
c.request(
"GET",
"/v1/AUTH_dfg/hat/hugeman",
'',
{"x-auth-token": "b590e834-baaa-7781-7bf2-faed179f80bd",
"Range": "bytes=-123456"})
resp = c.getresponse()
try:
p = resp.read()
except httplib.IncompleteRead as err:
print "didn't work!!! : %s" % err
else:
print "yaaaa!!!"
time.sleep(.1)
############################################################
yaaaa!!!
yaaaa!!!
yaaaa!!!
yaaaa!!!
yaaaa!!!
yaaaa!!!
yaaaa!!!
didn't work!!! : IncompleteRead(3699 bytes read, 119757 more expected)
didn't work!!! : IncompleteRead(3699 bytes read, 119757 more expected)
didn't work!!! : IncompleteRead(3699 bytes read, 119757 more expected)
didn't work!!! : IncompleteRead(69235 bytes read, 54221 more expected)
didn't work!!! : IncompleteRead(3699 bytes read, 119757 more expected)
yaaaa!!!
didn't work!!! : IncompleteRead(3699 bytes read, 119757 more expected)
yaaaa!!!
yaaaa!!!
yaaaa!!!
didn't work!!! : IncompleteRead(3699 bytes read, 119757 more expected)
didn't work!!! : IncompleteRead(3699 bytes read, 119757 more expected)
didn't work!!! : IncompleteRead(3699 bytes read, 119757 more expected)
didn't work!!! : IncompleteRead(3699 bytes read, 119757 more expected)
yaaaa!!!
yaaaa!!!
yaaaa!!!
yaaaa!!!
yaaaa!!!
didn't work!!! : IncompleteRead(3699 bytes read, 119757 more expected)
yaaaa!!!
yaaaa!!!
yaaaa!!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment