diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-05-29 09:05:12 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-05-29 09:05:12 +0000 |
commit | cec8e7eee09c84d32e7e8c6ae18d03a43eaa3e13 (patch) | |
tree | 7265c035f31625a2d0f631f43bd51128428213a9 /src/transport/plugin_transport_http_server.c | |
parent | 8c85ee6619a2580c239fe7807368bf8a6a8286fa (diff) | |
download | gnunet-cec8e7eee09c84d32e7e8c6ae18d03a43eaa3e13.tar.gz gnunet-cec8e7eee09c84d32e7e8c6ae18d03a43eaa3e13.zip |
- refactorind reverting last fix
Diffstat (limited to 'src/transport/plugin_transport_http_server.c')
-rw-r--r-- | src/transport/plugin_transport_http_server.c | 40 |
1 files changed, 7 insertions, 33 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index d8383b0a9..58c8fd215 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -32,18 +32,6 @@ | |||
32 | 32 | ||
33 | static struct Plugin * p; | 33 | static struct Plugin * p; |
34 | 34 | ||
35 | struct ServerConnection | ||
36 | { | ||
37 | /* _RECV or _SEND */ | ||
38 | int direction; | ||
39 | |||
40 | /* should this connection get disconnected? GNUNET_YES/NO */ | ||
41 | int disconnect; | ||
42 | |||
43 | struct Session *session; | ||
44 | struct MHD_Connection *mhd_conn; | ||
45 | }; | ||
46 | |||
47 | /** | 35 | /** |
48 | * Function that queries MHD's select sets and | 36 | * Function that queries MHD's select sets and |
49 | * starts the task waiting for them. | 37 | * starts the task waiting for them. |
@@ -540,14 +528,9 @@ create: | |||
540 | s = create_session (plugin, &target, a, a_len); | 528 | s = create_session (plugin, &target, a, a_len); |
541 | GNUNET_assert (NULL != s); | 529 | GNUNET_assert (NULL != s); |
542 | s->ats_address_network_type = ats.value; | 530 | s->ats_address_network_type = ats.value; |
543 | |||
544 | s->inbound = GNUNET_YES; | 531 | s->inbound = GNUNET_YES; |
545 | s->next_receive = GNUNET_TIME_UNIT_ZERO_ABS; | 532 | s->next_receive = GNUNET_TIME_UNIT_ZERO_ABS; |
546 | s->tag = tag; | 533 | s->tag = tag; |
547 | if (0 == strcmp (MHD_HTTP_METHOD_PUT, method)) | ||
548 | s->server_recv = s; | ||
549 | if (0 == strcmp (MHD_HTTP_METHOD_GET, method)) | ||
550 | s->server_send = s; | ||
551 | GNUNET_CONTAINER_DLL_insert (plugin->server_semi_head, | 534 | GNUNET_CONTAINER_DLL_insert (plugin->server_semi_head, |
552 | plugin->server_semi_tail, s); | 535 | plugin->server_semi_tail, s); |
553 | goto found; | 536 | goto found; |
@@ -853,24 +836,15 @@ server_disconnect_cb (void *cls, struct MHD_Connection *connection, | |||
853 | int | 836 | int |
854 | server_disconnect (struct Session *s) | 837 | server_disconnect (struct Session *s) |
855 | { | 838 | { |
856 | struct Plugin *plugin = s->plugin; | 839 | if (s->server_send != NULL) |
857 | struct Session *t = plugin->head; | ||
858 | |||
859 | while (t != NULL) | ||
860 | { | 840 | { |
861 | if (t->inbound == GNUNET_YES) | 841 | ((struct ServerConnection *) s->server_send)->disconnect = GNUNET_YES; |
862 | { | 842 | } |
863 | if (t->server_send != NULL) | 843 | if (s->server_recv != NULL) |
864 | { | 844 | { |
865 | ((struct ServerConnection *) t->server_send)->disconnect = GNUNET_YES; | 845 | ((struct ServerConnection *) s->server_recv)->disconnect = GNUNET_YES; |
866 | } | ||
867 | if (t->server_send != NULL) | ||
868 | { | ||
869 | ((struct ServerConnection *) t->server_send)->disconnect = GNUNET_YES; | ||
870 | } | ||
871 | } | ||
872 | t = t->next; | ||
873 | } | 846 | } |
847 | |||
874 | return GNUNET_OK; | 848 | return GNUNET_OK; |
875 | } | 849 | } |
876 | 850 | ||