From 1c66b3c347defc841efed00bfe682f6a4df431fe Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Thu, 10 May 2012 10:02:21 +0000 Subject: [PATCH] - added additional assertions --- src/transport/plugin_transport_http_server.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index 0ec26c88b..7e09245f1 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c @@ -376,12 +376,11 @@ server_lookup_session (struct Plugin *plugin, uint32_t tag = 0; int direction = GNUNET_SYSERR; - conn_info = - MHD_get_connection_info (mhd_connection, + conn_info = MHD_get_connection_info (mhd_connection, MHD_CONNECTION_INFO_CLIENT_ADDRESS); if ((conn_info->client_addr->sa_family != AF_INET) && (conn_info->client_addr->sa_family != AF_INET6)) - return MHD_NO; + return NULL; if ((strlen (&url[1]) >= 105) && (url[104] == ';')) { @@ -482,7 +481,7 @@ server_lookup_session (struct Plugin *plugin, "# HTTP inbound sessions", plugin->inbound_sessions, GNUNET_NO); - + GNUNET_assert (NULL != s); goto found; } if ((direction == _RECEIVE) && (t->server_recv != NULL)) @@ -506,7 +505,7 @@ server_lookup_session (struct Plugin *plugin, "# HTTP inbound sessions", plugin->inbound_sessions, GNUNET_NO); - + GNUNET_assert (NULL != s); goto found; } @@ -538,6 +537,7 @@ create: goto error; } s = create_session (plugin, &target, a, a_len, NULL, NULL); + GNUNET_assert (NULL != s); s->ats_address_network_type = ats.value; s->inbound = GNUNET_YES; @@ -628,6 +628,8 @@ server_access_cb (void *cls, struct MHD_Connection *mhd_connection, sc = (*httpSessionCache); s = sc->session; + GNUNET_assert (NULL != s); + /* connection is to be disconnected */ if (sc->disconnect == GNUNET_YES) { @@ -755,6 +757,7 @@ server_disconnect_cb (void *cls, struct MHD_Connection *connection, return; s = sc->session; + GNUNET_assert (NULL != s); GNUNET_assert (NULL != p); if (GNUNET_NO == exist_session(p, s)) return; -- 2.25.1