sockjs/sockjs-protocol — Issue #15: async=True, load=False test failed
Author: dvv
Created: 2011-10-19 10:46:39+00:00
State: open

Hi!

https://github.com/sockjs/sockjs-protocol/blob/master/sockjs-protocol-0.0.4-incomplete.py#L445-449 causes:

```
======================================================================
ERROR: test_simpleSession (__main__.Protocol)
----------------------------------------------------------------------
Traceback (most recent call last):
File "sockjs-protocol-0.0.4-incomplete.py", line 446, in test_simpleSession
r2 = POST(trans_url + '/xhr')
File "/home/dvv/LUA/sockjs-protocol/utils.py", line 79, in POST
return HttpResponse('POST', url, **kwargs)
File "/home/dvv/LUA/sockjs-protocol/utils.py", line 36, in __init__
self._load()
File "/home/dvv/LUA/sockjs-protocol/utils.py", line 52, in _load
self.body = self.res.read()
File "/home/dvv/LUA/sockjs-protocol/httplib.py", line 546, in read
s = self.fp.read()
File "/usr/lib/python2.7/socket.py", line 351, in read
data = self._sock.recv(rbufsize)
timeout: timed out
```

on both sockjs-luvit and latest sockjs-node. Solution is to always read response headers -- append at L39 of utils.py:

```python
else:
self.res = self.conn.getresponse()
```

Please, confirm or invalidate.

TIA,
--Vladimir