diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-05-10 10:02:21 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-05-10 10:02:21 +0000 |
commit | 1c66b3c347defc841efed00bfe682f6a4df431fe (patch) | |
tree | 3ce2eab119d964f5dbdfd059b69959372ce23a31 /src/transport/plugin_transport_http_server.c | |
parent | 5380874d6e9ed59c5115bd6ca1d4296aa13176b1 (diff) | |
download | gnunet-1c66b3c347defc841efed00bfe682f6a4df431fe.tar.gz gnunet-1c66b3c347defc841efed00bfe682f6a4df431fe.zip |
- added additional assertions
Diffstat (limited to 'src/transport/plugin_transport_http_server.c')
-rw-r--r-- | src/transport/plugin_transport_http_server.c | 13 |
1 files 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, | |||
376 | uint32_t tag = 0; | 376 | uint32_t tag = 0; |
377 | int direction = GNUNET_SYSERR; | 377 | int direction = GNUNET_SYSERR; |
378 | 378 | ||
379 | conn_info = | 379 | conn_info = MHD_get_connection_info (mhd_connection, |
380 | MHD_get_connection_info (mhd_connection, | ||
381 | MHD_CONNECTION_INFO_CLIENT_ADDRESS); | 380 | MHD_CONNECTION_INFO_CLIENT_ADDRESS); |
382 | if ((conn_info->client_addr->sa_family != AF_INET) && | 381 | if ((conn_info->client_addr->sa_family != AF_INET) && |
383 | (conn_info->client_addr->sa_family != AF_INET6)) | 382 | (conn_info->client_addr->sa_family != AF_INET6)) |
384 | return MHD_NO; | 383 | return NULL; |
385 | 384 | ||
386 | if ((strlen (&url[1]) >= 105) && (url[104] == ';')) | 385 | if ((strlen (&url[1]) >= 105) && (url[104] == ';')) |
387 | { | 386 | { |
@@ -482,7 +481,7 @@ server_lookup_session (struct Plugin *plugin, | |||
482 | "# HTTP inbound sessions", | 481 | "# HTTP inbound sessions", |
483 | plugin->inbound_sessions, | 482 | plugin->inbound_sessions, |
484 | GNUNET_NO); | 483 | GNUNET_NO); |
485 | 484 | GNUNET_assert (NULL != s); | |
486 | goto found; | 485 | goto found; |
487 | } | 486 | } |
488 | if ((direction == _RECEIVE) && (t->server_recv != NULL)) | 487 | if ((direction == _RECEIVE) && (t->server_recv != NULL)) |
@@ -506,7 +505,7 @@ server_lookup_session (struct Plugin *plugin, | |||
506 | "# HTTP inbound sessions", | 505 | "# HTTP inbound sessions", |
507 | plugin->inbound_sessions, | 506 | plugin->inbound_sessions, |
508 | GNUNET_NO); | 507 | GNUNET_NO); |
509 | 508 | GNUNET_assert (NULL != s); | |
510 | goto found; | 509 | goto found; |
511 | } | 510 | } |
512 | 511 | ||
@@ -538,6 +537,7 @@ create: | |||
538 | goto error; | 537 | goto error; |
539 | } | 538 | } |
540 | s = create_session (plugin, &target, a, a_len, NULL, NULL); | 539 | s = create_session (plugin, &target, a, a_len, NULL, NULL); |
540 | GNUNET_assert (NULL != s); | ||
541 | s->ats_address_network_type = ats.value; | 541 | s->ats_address_network_type = ats.value; |
542 | 542 | ||
543 | s->inbound = GNUNET_YES; | 543 | s->inbound = GNUNET_YES; |
@@ -628,6 +628,8 @@ server_access_cb (void *cls, struct MHD_Connection *mhd_connection, | |||
628 | sc = (*httpSessionCache); | 628 | sc = (*httpSessionCache); |
629 | s = sc->session; | 629 | s = sc->session; |
630 | 630 | ||
631 | GNUNET_assert (NULL != s); | ||
632 | |||
631 | /* connection is to be disconnected */ | 633 | /* connection is to be disconnected */ |
632 | if (sc->disconnect == GNUNET_YES) | 634 | if (sc->disconnect == GNUNET_YES) |
633 | { | 635 | { |
@@ -755,6 +757,7 @@ server_disconnect_cb (void *cls, struct MHD_Connection *connection, | |||
755 | return; | 757 | return; |
756 | 758 | ||
757 | s = sc->session; | 759 | s = sc->session; |
760 | GNUNET_assert (NULL != s); | ||
758 | GNUNET_assert (NULL != p); | 761 | GNUNET_assert (NULL != p); |
759 | if (GNUNET_NO == exist_session(p, s)) | 762 | if (GNUNET_NO == exist_session(p, s)) |
760 | return; | 763 | return; |