http: update timeout queue when destroying connection
authorStefan Becker <chemobejk@gmail.com>
Wed, 10 Jul 2013 14:39:45 +0000 (10 17:39 +0300)
committerStefan Becker <chemobejk@gmail.com>
Sat, 13 Jul 2013 12:55:50 +0000 (13 15:55 +0300)
IMHO this is what commit af872c542c62926c39be6f50391dddc5d360eac9 tried
to fix.

(cherry picked from commit a51aff1b160c5e9ca699c2c660d24047b8577468)

src/core/sipe-http-transport.c

index d08d497..04792a1 100644 (file)
@@ -78,10 +78,11 @@ static gint timeout_compare(gconstpointer a,
               ((struct sipe_http_connection *) b)->timeout);
 }
 
+static void sipe_http_transport_update_timeout_queue(struct sipe_http_connection *conn,
+                                                    gboolean remove);
 static void sipe_http_transport_free(gpointer data)
 {
        struct sipe_http_connection *conn = data;
-       struct sipe_http *http = conn->public.sipe_private->http;
 
        SIPE_DEBUG_INFO("sipe_http_transport_free: destroying connection '%s'",
                        conn->host_port);
@@ -90,7 +91,7 @@ static void sipe_http_transport_free(gpointer data)
                sipe_backend_transport_disconnect(conn->connection);
        conn->connection = NULL;
 
-       g_queue_remove(http->timeouts, conn);
+       sipe_http_transport_update_timeout_queue(conn, TRUE);
 
        sipe_http_request_shutdown(SIPE_HTTP_CONNECTION_PUBLIC);