plivo / plivoframework

Open Source Telephony Application Prototyping Framework
http://www.plivo.com/open-source/
Other
418 stars 179 forks source link

#96 - fix call of server handle in Gevents Hub context #132

Open AndreiPashkin opened 9 years ago

AndreiPashkin commented 9 years ago

Before that patch, request handler of the server was executed in Gevents Hub context. Which is wrong, because inside it it is impossible to use Gevent blocking API, and servers handle uses it.

This patch fixed it - instead of overriding do_handle method, which is not supposed to be overriden, server just uses public interface of StreamServer and passes handle to it's init.

It fixes #96.

Here is the minimal setup, that reproduces this problem:

https://gist.github.com/AndrewPashkin/b6405a1e565885f015c3