aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Barksdale <amatus.amongus@gmail.com>2014-07-02 15:27:39 +0000
committerDavid Barksdale <amatus.amongus@gmail.com>2014-07-02 15:27:39 +0000
commit9ae796ef10ccbcd1e31522a6ce522524657bf58c (patch)
tree33706c8ca0510bd463e83d0005b643c00deb18d6
parent0255e3026f4553ecfe5098d7f96c05ffca982a52 (diff)
downloadgnunet-9ae796ef10ccbcd1e31522a6ce522524657bf58c.tar.gz
gnunet-9ae796ef10ccbcd1e31522a6ce522524657bf58c.zip
Simplify HTTP server session cleanup even more
Allow HTTP clients to get disconnected without deleting their session so they can re-connect quickly. This also works for XHR clients which need to disconnect to work.
-rw-r--r--src/transport/plugin_transport_http_server.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 6a6f28e8b..f6c64e602 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -1905,16 +1905,8 @@ server_disconnect_cb (void *cls,
1905 s->address->address, 1905 s->address->address,
1906 s->address->address_length)); 1906 s->address->address_length));
1907 s->server_send = NULL; 1907 s->server_send = NULL;
1908 if (! ( (0 != (sc->options & OPTION_LONG_POLL)) &&
1909 (NULL != s->server_recv) ) )
1910 {
1911 server_delete_session (s);
1912 GNUNET_free (sc);
1913 plugin->cur_connections--;
1914 return;
1915 }
1916 } 1908 }
1917 if (sc->direction == _RECEIVE) 1909 else if (sc->direction == _RECEIVE)
1918 { 1910 {
1919 LOG (GNUNET_ERROR_TYPE_DEBUG, 1911 LOG (GNUNET_ERROR_TYPE_DEBUG,
1920 "Peer `%s' connection %p PUT on address `%s' disconnected\n", 1912 "Peer `%s' connection %p PUT on address `%s' disconnected\n",
@@ -1932,19 +1924,6 @@ server_disconnect_cb (void *cls,
1932 } 1924 }
1933 GNUNET_free (sc); 1925 GNUNET_free (sc);
1934 plugin->cur_connections--; 1926 plugin->cur_connections--;
1935
1936 if ( (NULL == s->server_send) &&
1937 (NULL == s->server_recv) )
1938 {
1939 LOG (GNUNET_ERROR_TYPE_DEBUG,
1940 "Peer `%s' on address `%s' disconnected\n",
1941 GNUNET_i2s (&s->target),
1942 http_common_plugin_address_to_string (plugin->protocol,
1943 s->address->address,
1944 s->address->address_length));
1945
1946 server_delete_session (s);
1947 }
1948} 1927}
1949 1928
1950 1929