diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-11-07 16:33:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-11-07 16:33:42 +0000 |
commit | 0c89b2a16eae49cb23635f6d6c0f13da070c5c66 (patch) | |
tree | 559186ca56ac1279a611d31f3bf3816bc971431c /src/transport/plugin_transport_http_client.c | |
parent | 2e33b6fcbad3c1b8ebf7176c39a201c39b23c2b2 (diff) | |
download | gnunet-0c89b2a16eae49cb23635f6d6c0f13da070c5c66.tar.gz gnunet-0c89b2a16eae49cb23635f6d6c0f13da070c5c66.zip |
implementing plugin session monitoring API (#3452)
Diffstat (limited to 'src/transport/plugin_transport_http_client.c')
-rw-r--r-- | src/transport/plugin_transport_http_client.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c index 615639a6e..adb83c719 100644 --- a/src/transport/plugin_transport_http_client.c +++ b/src/transport/plugin_transport_http_client.c | |||
@@ -519,7 +519,7 @@ client_delete_session (struct Session *s) | |||
519 | GNUNET_assert (0 == s->bytes_in_queue); | 519 | GNUNET_assert (0 == s->bytes_in_queue); |
520 | notify_session_monitor (plugin, | 520 | notify_session_monitor (plugin, |
521 | s, | 521 | s, |
522 | GNUNET_TRANSPORT_SS_DOWN); | 522 | GNUNET_TRANSPORT_SS_DONE); |
523 | if (NULL != s->msg_tk) | 523 | if (NULL != s->msg_tk) |
524 | { | 524 | { |
525 | GNUNET_SERVER_mst_destroy (s->msg_tk); | 525 | GNUNET_SERVER_mst_destroy (s->msg_tk); |
@@ -778,7 +778,7 @@ http_client_plugin_send (void *cls, | |||
778 | GNUNET_free (stat_txt); | 778 | GNUNET_free (stat_txt); |
779 | notify_session_monitor (plugin, | 779 | notify_session_monitor (plugin, |
780 | s, | 780 | s, |
781 | GNUNET_TRANSPORT_SS_UP); | 781 | GNUNET_TRANSPORT_SS_UPDATE); |
782 | if (H_TMP_DISCONNECTING == s->put.state) | 782 | if (H_TMP_DISCONNECTING == s->put.state) |
783 | { | 783 | { |
784 | /* PUT request is currently getting disconnected */ | 784 | /* PUT request is currently getting disconnected */ |
@@ -1078,7 +1078,7 @@ client_send_cb (void *stream, | |||
1078 | } | 1078 | } |
1079 | notify_session_monitor (plugin, | 1079 | notify_session_monitor (plugin, |
1080 | s, | 1080 | s, |
1081 | GNUNET_TRANSPORT_SS_UP); | 1081 | GNUNET_TRANSPORT_SS_UPDATE); |
1082 | GNUNET_asprintf (&stat_txt, | 1082 | GNUNET_asprintf (&stat_txt, |
1083 | "# bytes currently in %s_client buffers", | 1083 | "# bytes currently in %s_client buffers", |
1084 | plugin->protocol); | 1084 | plugin->protocol); |
@@ -1741,7 +1741,7 @@ client_session_timeout (void *cls, | |||
1741 | the monitor, it may think we're about to die ... */ | 1741 | the monitor, it may think we're about to die ... */ |
1742 | notify_session_monitor (s->plugin, | 1742 | notify_session_monitor (s->plugin, |
1743 | s, | 1743 | s, |
1744 | GNUNET_TRANSPORT_SS_UP); | 1744 | GNUNET_TRANSPORT_SS_UPDATE); |
1745 | s->timeout_task = GNUNET_SCHEDULER_add_delayed (left, | 1745 | s->timeout_task = GNUNET_SCHEDULER_add_delayed (left, |
1746 | &client_session_timeout, | 1746 | &client_session_timeout, |
1747 | s); | 1747 | s); |
@@ -1860,7 +1860,12 @@ http_client_plugin_get_session (void *cls, | |||
1860 | client_delete_session (s); | 1860 | client_delete_session (s); |
1861 | return NULL; | 1861 | return NULL; |
1862 | } | 1862 | } |
1863 | notify_session_monitor (plugin, s, GNUNET_TRANSPORT_SS_UP); /* or handshake? */ | 1863 | notify_session_monitor (plugin, |
1864 | s, | ||
1865 | GNUNET_TRANSPORT_SS_INIT); | ||
1866 | notify_session_monitor (plugin, | ||
1867 | s, | ||
1868 | GNUNET_TRANSPORT_SS_UP); /* or handshake? */ | ||
1864 | return s; | 1869 | return s; |
1865 | } | 1870 | } |
1866 | 1871 | ||
@@ -2162,7 +2167,10 @@ send_session_info_iter (void *cls, | |||
2162 | 2167 | ||
2163 | notify_session_monitor (plugin, | 2168 | notify_session_monitor (plugin, |
2164 | session, | 2169 | session, |
2165 | GNUNET_TRANSPORT_SS_UP); | 2170 | GNUNET_TRANSPORT_SS_INIT); |
2171 | notify_session_monitor (plugin, | ||
2172 | session, | ||
2173 | GNUNET_TRANSPORT_SS_UP); /* FIXME: or handshake? */ | ||
2166 | return GNUNET_OK; | 2174 | return GNUNET_OK; |
2167 | } | 2175 | } |
2168 | 2176 | ||