crossbario / crossbario/autobahn-python
Issue with streaming websocket twisted example
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 768
- PR merge metrics
- No merged PRs in 30d
Description
Python 2.7.11
Running: autobahn-python-master\examples\twisted\websocket\streaming[_producer]_client.py
Line:
FRAME_SIZE = 0x7FFFFFFFFFFFFFFF
evaluates to type long, thus the following test throws an exception from autobahn.websocket.protocol:
if type(length) != int or length < 0 or length > 0x7FFFFFFFFFFFFFFF: # 2**63
raise Exception("invalid value for message frame length")
print type(0x7FFFFFFF)
<type 'int'>
print type(0x7FFFFFFF+1)
<type 'long'>
To fix the example clients, change that code to should use:
FRAME_SIZE = 0x7FFFFFFF
Q: Should the source retain the "type()" conditional part?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with examples/twisted/websocket/streaming[_producer]_client.py and inspect the length validation in autobahn.websocket.protocol. Reproduce the exception under Python 2.7.11, then verify the example clients run successfully and settle whether the type() check should remain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100