Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions plugins/gevent/gevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,14 @@ static void gevent_loop() {
ugevent.watchers = uwsgi_malloc(sizeof(PyObject *) * uwsgi_count_sockets(uwsgi.sockets));
int i = 0;
while(uwsgi_sock) {
// this is the watcher for server socket
ugevent.watchers[i] = PyObject_CallMethod(ugevent.hub_loop, "io", "ii", uwsgi_sock->fd, 1);
if (!ugevent.watchers[i]) uwsgi_pyexit;
if (uwsgi_sock->fd >= 0) {
// this is the watcher for server socket
ugevent.watchers[i] = PyObject_CallMethod(ugevent.hub_loop, "io", "ii", uwsgi_sock->fd, 1);
if (!ugevent.watchers[i]) uwsgi_pyexit;

// start the main greenlet
start_watcher(i, uwsgi_sock);
// start the main greenlet
start_watcher(i, uwsgi_sock);
}
uwsgi_sock = uwsgi_sock->next;
i++;
}
Expand Down