Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes binary data sending #62

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Fixes binary data sending #62

wants to merge 7 commits into from

Conversation

Wrangl
Copy link

@Wrangl Wrangl commented Jul 12, 2017

Binary data was not actually pointing to the correct uwsgi internal call when using the gevent loop engine.

Wrangl added 2 commits July 12, 2017 04:54
Binary data was not actually pointing to the correct uwsgi internal call when using the gevent loop engine.
@@ -119,6 +126,7 @@ def listener(client):
# should be able to ignore it anyway.
while message:
message = uwsgi.websocket_recv_nb()
print(str(repr(message)))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to keep, can you wrap with a debug flag?

@@ -68,10 +70,12 @@ def __call__(self, environ, start_response):

recv_event = Event()
recv_queue = Queue()

is_binary = Event()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to use an event vs boolean?

self.environ = environ
self.fd = fd
self.send_event = send_event
self.send_queue = send_queue
self.recv_event = recv_event
self.recv_queue = recv_queue
self.timeout = timeout
self.timeout = 6000
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not hardcode the timeout here :)

@@ -81,6 +85,7 @@ def __call__(self, environ, start_response):
def listener(client):
# wait max `client.timeout` seconds to allow ping to be sent
select([client.fd], [], [], client.timeout)
print('we received a message')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary logging.

@@ -68,10 +71,11 @@ def __call__(self, environ, start_response):

recv_event = Event()
recv_queue = Queue()
is_binary = Event()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not clear why a boolean will not work here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants