Ticket #28912: mainloop.patch

File mainloop.patch, 1.2 KB (added by plcp`, 5 weeks ago)
  • src/core/mainloop/mainloop.c

    diff --git a/src/core/mainloop/mainloop.c b/src/core/mainloop/mainloop.c
    index 834587bb7..cfddb76f0 100644
    a b connection_unlink(connection_t *conn) 
    377377  connection_free(conn);
    378378}
    379379
     380/** Event that invokes schedule_active_linked_connections_cb. */
     381static mainloop_event_t *schedule_active_linked_connections_event = NULL;
     382
    380383/**
    381384 * Callback: used to activate read events for all linked connections, so
    382385 * libevent knows to call their read callbacks.  This callback run as a
    schedule_active_linked_connections_cb(mainloop_event_t *event, void *arg) 
    393396   * so that libevent knows to run their callbacks. */
    394397  SMARTLIST_FOREACH(active_linked_connection_lst, connection_t *, conn,
    395398                    event_active(conn->read_event, EV_READ, 1));
    396 }
    397399
    398 /** Event that invokes schedule_active_linked_connections_cb. */
    399 static mainloop_event_t *schedule_active_linked_connections_event = NULL;
     400  if (smartlist_len(active_linked_connection_lst)) //QQQ: vvv safe?
     401    mainloop_event_activate(schedule_active_linked_connections_event);
     402}
    400403
    401404/** Initialize the global connection list, closeable connection list,
    402405 * and active connection list. */