diff options
Diffstat (limited to 'src/transport/plugin_transport_http_server.c')
-rw-r--r-- | src/transport/plugin_transport_http_server.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index db483098a..07137e0fb 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -63,7 +63,7 @@ struct ServerRequest | |||
63 | * The session this server request belongs to | 63 | * The session this server request belongs to |
64 | * Can be NULL, when session was disconnected and freed | 64 | * Can be NULL, when session was disconnected and freed |
65 | */ | 65 | */ |
66 | struct Session *session; | 66 | struct GNUNET_ATS_Session *session; |
67 | 67 | ||
68 | /** | 68 | /** |
69 | * The MHD connection | 69 | * The MHD connection |
@@ -174,7 +174,7 @@ struct HTTP_Message | |||
174 | /** | 174 | /** |
175 | * Session handle for connections. | 175 | * Session handle for connections. |
176 | */ | 176 | */ |
177 | struct Session | 177 | struct GNUNET_ATS_Session |
178 | { | 178 | { |
179 | 179 | ||
180 | /** | 180 | /** |
@@ -466,7 +466,7 @@ struct HTTP_Server_Plugin | |||
466 | */ | 466 | */ |
467 | static void | 467 | static void |
468 | notify_session_monitor (struct HTTP_Server_Plugin *plugin, | 468 | notify_session_monitor (struct HTTP_Server_Plugin *plugin, |
469 | struct Session *session, | 469 | struct GNUNET_ATS_Session *session, |
470 | enum GNUNET_TRANSPORT_SessionState state) | 470 | enum GNUNET_TRANSPORT_SessionState state) |
471 | { | 471 | { |
472 | struct GNUNET_TRANSPORT_SessionInfo info; | 472 | struct GNUNET_TRANSPORT_SessionInfo info; |
@@ -497,7 +497,7 @@ static void | |||
497 | server_wake_up (void *cls, | 497 | server_wake_up (void *cls, |
498 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 498 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
499 | { | 499 | { |
500 | struct Session *s = cls; | 500 | struct GNUNET_ATS_Session *s = cls; |
501 | 501 | ||
502 | s->recv_wakeup_task = NULL; | 502 | s->recv_wakeup_task = NULL; |
503 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 503 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
@@ -529,7 +529,7 @@ server_reschedule (struct HTTP_Server_Plugin *plugin, | |||
529 | * @param s the session to delete | 529 | * @param s the session to delete |
530 | */ | 530 | */ |
531 | static void | 531 | static void |
532 | server_delete_session (struct Session *s) | 532 | server_delete_session (struct GNUNET_ATS_Session *s) |
533 | { | 533 | { |
534 | struct HTTP_Server_Plugin *plugin = s->plugin; | 534 | struct HTTP_Server_Plugin *plugin = s->plugin; |
535 | struct HTTP_Message *msg; | 535 | struct HTTP_Message *msg; |
@@ -630,7 +630,7 @@ server_delete_session (struct Session *s) | |||
630 | */ | 630 | */ |
631 | static int | 631 | static int |
632 | http_server_plugin_disconnect_session (void *cls, | 632 | http_server_plugin_disconnect_session (void *cls, |
633 | struct Session *s) | 633 | struct GNUNET_ATS_Session *s) |
634 | { | 634 | { |
635 | server_delete_session (s); | 635 | server_delete_session (s); |
636 | return GNUNET_OK; | 636 | return GNUNET_OK; |
@@ -647,7 +647,7 @@ static void | |||
647 | server_session_timeout (void *cls, | 647 | server_session_timeout (void *cls, |
648 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 648 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
649 | { | 649 | { |
650 | struct Session *s = cls; | 650 | struct GNUNET_ATS_Session *s = cls; |
651 | struct GNUNET_TIME_Relative left; | 651 | struct GNUNET_TIME_Relative left; |
652 | 652 | ||
653 | s->timeout_task = NULL; | 653 | s->timeout_task = NULL; |
@@ -679,7 +679,7 @@ server_session_timeout (void *cls, | |||
679 | * @param s the session | 679 | * @param s the session |
680 | */ | 680 | */ |
681 | static void | 681 | static void |
682 | server_reschedule_session_timeout (struct Session *s) | 682 | server_reschedule_session_timeout (struct GNUNET_ATS_Session *s) |
683 | { | 683 | { |
684 | GNUNET_assert (NULL != s->timeout_task); | 684 | GNUNET_assert (NULL != s->timeout_task); |
685 | s->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); | 685 | s->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); |
@@ -715,7 +715,7 @@ server_reschedule_session_timeout (struct Session *s) | |||
715 | */ | 715 | */ |
716 | static ssize_t | 716 | static ssize_t |
717 | http_server_plugin_send (void *cls, | 717 | http_server_plugin_send (void *cls, |
718 | struct Session *session, | 718 | struct GNUNET_ATS_Session *session, |
719 | const char *msgbuf, | 719 | const char *msgbuf, |
720 | size_t msgbuf_size, | 720 | size_t msgbuf_size, |
721 | unsigned int priority, | 721 | unsigned int priority, |
@@ -775,7 +775,7 @@ http_server_plugin_send (void *cls, | |||
775 | * | 775 | * |
776 | * @param cls the `struct HTTP_Server_Plugin *` | 776 | * @param cls the `struct HTTP_Server_Plugin *` |
777 | * @param peer for which this is a session | 777 | * @param peer for which this is a session |
778 | * @param value the `struct Session` to clean up | 778 | * @param value the `struct GNUNET_ATS_Session` to clean up |
779 | * @return #GNUNET_OK (continue to iterate) | 779 | * @return #GNUNET_OK (continue to iterate) |
780 | */ | 780 | */ |
781 | static int | 781 | static int |
@@ -783,7 +783,7 @@ destroy_session_shutdown_cb (void *cls, | |||
783 | const struct GNUNET_PeerIdentity *peer, | 783 | const struct GNUNET_PeerIdentity *peer, |
784 | void *value) | 784 | void *value) |
785 | { | 785 | { |
786 | struct Session *s = value; | 786 | struct GNUNET_ATS_Session *s = value; |
787 | struct ServerRequest *sc_send; | 787 | struct ServerRequest *sc_send; |
788 | struct ServerRequest *sc_recv; | 788 | struct ServerRequest *sc_recv; |
789 | 789 | ||
@@ -802,7 +802,7 @@ destroy_session_shutdown_cb (void *cls, | |||
802 | * | 802 | * |
803 | * @param cls the `struct HTTP_Server_Plugin *` | 803 | * @param cls the `struct HTTP_Server_Plugin *` |
804 | * @param peer for which this is a session | 804 | * @param peer for which this is a session |
805 | * @param value the `struct Session` to clean up | 805 | * @param value the `struct GNUNET_ATS_Session` to clean up |
806 | * @return #GNUNET_OK (continue to iterate) | 806 | * @return #GNUNET_OK (continue to iterate) |
807 | */ | 807 | */ |
808 | static int | 808 | static int |
@@ -810,7 +810,7 @@ destroy_session_cb (void *cls, | |||
810 | const struct GNUNET_PeerIdentity *peer, | 810 | const struct GNUNET_PeerIdentity *peer, |
811 | void *value) | 811 | void *value) |
812 | { | 812 | { |
813 | struct Session *s = value; | 813 | struct GNUNET_ATS_Session *s = value; |
814 | 814 | ||
815 | server_delete_session (s); | 815 | server_delete_session (s); |
816 | return GNUNET_OK; | 816 | return GNUNET_OK; |
@@ -897,7 +897,7 @@ http_server_plugin_address_suggested (void *cls, | |||
897 | * @param address the address | 897 | * @param address the address |
898 | * @return always NULL | 898 | * @return always NULL |
899 | */ | 899 | */ |
900 | static struct Session * | 900 | static struct GNUNET_ATS_Session * |
901 | http_server_plugin_get_session (void *cls, | 901 | http_server_plugin_get_session (void *cls, |
902 | const struct GNUNET_HELLO_Address *address) | 902 | const struct GNUNET_HELLO_Address *address) |
903 | { | 903 | { |
@@ -1127,7 +1127,7 @@ http_server_query_keepalive_factor (void *cls) | |||
1127 | static void | 1127 | static void |
1128 | http_server_plugin_update_session_timeout (void *cls, | 1128 | http_server_plugin_update_session_timeout (void *cls, |
1129 | const struct GNUNET_PeerIdentity *peer, | 1129 | const struct GNUNET_PeerIdentity *peer, |
1130 | struct Session *session) | 1130 | struct GNUNET_ATS_Session *session) |
1131 | { | 1131 | { |
1132 | server_reschedule_session_timeout (session); | 1132 | server_reschedule_session_timeout (session); |
1133 | } | 1133 | } |
@@ -1142,7 +1142,7 @@ http_server_plugin_update_session_timeout (void *cls, | |||
1142 | */ | 1142 | */ |
1143 | static void | 1143 | static void |
1144 | server_mhd_connection_timeout (struct HTTP_Server_Plugin *plugin, | 1144 | server_mhd_connection_timeout (struct HTTP_Server_Plugin *plugin, |
1145 | struct Session *s, | 1145 | struct GNUNET_ATS_Session *s, |
1146 | unsigned int to) | 1146 | unsigned int to) |
1147 | { | 1147 | { |
1148 | /* Setting timeouts for other connections */ | 1148 | /* Setting timeouts for other connections */ |
@@ -1305,12 +1305,12 @@ server_parse_url (struct HTTP_Server_Plugin *plugin, | |||
1305 | /** | 1305 | /** |
1306 | * Closure for #session_tag_it(). | 1306 | * Closure for #session_tag_it(). |
1307 | */ | 1307 | */ |
1308 | struct SessionTagContext | 1308 | struct GNUNET_ATS_SessionTagContext |
1309 | { | 1309 | { |
1310 | /** | 1310 | /** |
1311 | * Set to session matching the tag. | 1311 | * Set to session matching the tag. |
1312 | */ | 1312 | */ |
1313 | struct Session *res; | 1313 | struct GNUNET_ATS_Session *res; |
1314 | 1314 | ||
1315 | /** | 1315 | /** |
1316 | * Tag we are looking for. | 1316 | * Tag we are looking for. |
@@ -1322,9 +1322,9 @@ struct SessionTagContext | |||
1322 | /** | 1322 | /** |
1323 | * Find a session with a matching tag. | 1323 | * Find a session with a matching tag. |
1324 | * | 1324 | * |
1325 | * @param cls the `struct SessionTagContext *` | 1325 | * @param cls the `struct GNUNET_ATS_SessionTagContext *` |
1326 | * @param key peer identity (unused) | 1326 | * @param key peer identity (unused) |
1327 | * @param value the `struct Session *` | 1327 | * @param value the `struct GNUNET_ATS_Session *` |
1328 | * @return #GNUNET_NO if we found the session, #GNUNET_OK if not | 1328 | * @return #GNUNET_NO if we found the session, #GNUNET_OK if not |
1329 | */ | 1329 | */ |
1330 | static int | 1330 | static int |
@@ -1332,8 +1332,8 @@ session_tag_it (void *cls, | |||
1332 | const struct GNUNET_PeerIdentity *key, | 1332 | const struct GNUNET_PeerIdentity *key, |
1333 | void *value) | 1333 | void *value) |
1334 | { | 1334 | { |
1335 | struct SessionTagContext *stc = cls; | 1335 | struct GNUNET_ATS_SessionTagContext *stc = cls; |
1336 | struct Session *s = value; | 1336 | struct GNUNET_ATS_Session *s = value; |
1337 | 1337 | ||
1338 | if (s->tag == stc->tag) | 1338 | if (s->tag == stc->tag) |
1339 | { | 1339 | { |
@@ -1359,13 +1359,13 @@ server_lookup_connection (struct HTTP_Server_Plugin *plugin, | |||
1359 | const char *url, | 1359 | const char *url, |
1360 | const char *method) | 1360 | const char *method) |
1361 | { | 1361 | { |
1362 | struct Session *s = NULL; | 1362 | struct GNUNET_ATS_Session *s = NULL; |
1363 | struct ServerRequest *sc = NULL; | 1363 | struct ServerRequest *sc = NULL; |
1364 | const union MHD_ConnectionInfo *conn_info; | 1364 | const union MHD_ConnectionInfo *conn_info; |
1365 | struct HttpAddress *addr; | 1365 | struct HttpAddress *addr; |
1366 | struct GNUNET_PeerIdentity target; | 1366 | struct GNUNET_PeerIdentity target; |
1367 | size_t addr_len; | 1367 | size_t addr_len; |
1368 | struct SessionTagContext stc; | 1368 | struct GNUNET_ATS_SessionTagContext stc; |
1369 | uint32_t options; | 1369 | uint32_t options; |
1370 | int direction = GNUNET_SYSERR; | 1370 | int direction = GNUNET_SYSERR; |
1371 | unsigned int to; | 1371 | unsigned int to; |
@@ -1442,7 +1442,7 @@ server_lookup_connection (struct HTTP_Server_Plugin *plugin, | |||
1442 | /* external host name */ | 1442 | /* external host name */ |
1443 | return NULL; | 1443 | return NULL; |
1444 | } | 1444 | } |
1445 | s = GNUNET_new (struct Session); | 1445 | s = GNUNET_new (struct GNUNET_ATS_Session); |
1446 | s->target = target; | 1446 | s->target = target; |
1447 | s->plugin = plugin; | 1447 | s->plugin = plugin; |
1448 | s->scope = scope; | 1448 | s->scope = scope; |
@@ -1548,7 +1548,7 @@ server_send_callback (void *cls, | |||
1548 | size_t max) | 1548 | size_t max) |
1549 | { | 1549 | { |
1550 | struct ServerRequest *sc = cls; | 1550 | struct ServerRequest *sc = cls; |
1551 | struct Session *s = sc->session; | 1551 | struct GNUNET_ATS_Session *s = sc->session; |
1552 | ssize_t bytes_read = 0; | 1552 | ssize_t bytes_read = 0; |
1553 | struct HTTP_Message *msg; | 1553 | struct HTTP_Message *msg; |
1554 | char *stat_txt; | 1554 | char *stat_txt; |
@@ -1638,7 +1638,7 @@ server_receive_mst_cb (void *cls, | |||
1638 | void *client, | 1638 | void *client, |
1639 | const struct GNUNET_MessageHeader *message) | 1639 | const struct GNUNET_MessageHeader *message) |
1640 | { | 1640 | { |
1641 | struct Session *s = cls; | 1641 | struct GNUNET_ATS_Session *s = cls; |
1642 | struct HTTP_Server_Plugin *plugin = s->plugin; | 1642 | struct HTTP_Server_Plugin *plugin = s->plugin; |
1643 | struct GNUNET_TIME_Relative delay; | 1643 | struct GNUNET_TIME_Relative delay; |
1644 | char *stat_txt; | 1644 | char *stat_txt; |
@@ -1727,7 +1727,7 @@ server_access_cb (void *cls, | |||
1727 | { | 1727 | { |
1728 | struct HTTP_Server_Plugin *plugin = cls; | 1728 | struct HTTP_Server_Plugin *plugin = cls; |
1729 | struct ServerRequest *sc = *httpSessionCache; | 1729 | struct ServerRequest *sc = *httpSessionCache; |
1730 | struct Session *s; | 1730 | struct GNUNET_ATS_Session *s; |
1731 | struct MHD_Response *response; | 1731 | struct MHD_Response *response; |
1732 | int res = MHD_YES; | 1732 | int res = MHD_YES; |
1733 | 1733 | ||
@@ -3257,7 +3257,7 @@ http_server_plugin_address_to_string (void *cls, | |||
3257 | */ | 3257 | */ |
3258 | static enum GNUNET_ATS_Network_Type | 3258 | static enum GNUNET_ATS_Network_Type |
3259 | http_server_plugin_get_network (void *cls, | 3259 | http_server_plugin_get_network (void *cls, |
3260 | struct Session *session) | 3260 | struct GNUNET_ATS_Session *session) |
3261 | { | 3261 | { |
3262 | return session->scope; | 3262 | return session->scope; |
3263 | } | 3263 | } |
@@ -3294,7 +3294,7 @@ http_server_plugin_get_network_for_address (void *cls, | |||
3294 | static void | 3294 | static void |
3295 | http_server_plugin_update_inbound_delay (void *cls, | 3295 | http_server_plugin_update_inbound_delay (void *cls, |
3296 | const struct GNUNET_PeerIdentity *peer, | 3296 | const struct GNUNET_PeerIdentity *peer, |
3297 | struct Session *session, | 3297 | struct GNUNET_ATS_Session *session, |
3298 | struct GNUNET_TIME_Relative delay) | 3298 | struct GNUNET_TIME_Relative delay) |
3299 | { | 3299 | { |
3300 | session->next_receive = GNUNET_TIME_relative_to_absolute (delay); | 3300 | session->next_receive = GNUNET_TIME_relative_to_absolute (delay); |
@@ -3319,7 +3319,7 @@ http_server_plugin_update_inbound_delay (void *cls, | |||
3319 | * | 3319 | * |
3320 | * @param cls the `struct Plugin` with the monitor callback (`sic`) | 3320 | * @param cls the `struct Plugin` with the monitor callback (`sic`) |
3321 | * @param peer peer we send information about | 3321 | * @param peer peer we send information about |
3322 | * @param value our `struct Session` to send information about | 3322 | * @param value our `struct GNUNET_ATS_Session` to send information about |
3323 | * @return #GNUNET_OK (continue to iterate) | 3323 | * @return #GNUNET_OK (continue to iterate) |
3324 | */ | 3324 | */ |
3325 | static int | 3325 | static int |
@@ -3328,7 +3328,7 @@ send_session_info_iter (void *cls, | |||
3328 | void *value) | 3328 | void *value) |
3329 | { | 3329 | { |
3330 | struct HTTP_Server_Plugin *plugin = cls; | 3330 | struct HTTP_Server_Plugin *plugin = cls; |
3331 | struct Session *session = value; | 3331 | struct GNUNET_ATS_Session *session = value; |
3332 | 3332 | ||
3333 | notify_session_monitor (plugin, | 3333 | notify_session_monitor (plugin, |
3334 | session, | 3334 | session, |