diff options
Diffstat (limited to 'src/gns/gnunet-gns-proxy.c')
-rw-r--r-- | src/gns/gnunet-gns-proxy.c | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index 3b5adc8b1..9a34c83af 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c | |||
@@ -1257,10 +1257,9 @@ curl_upload_cb (void *buf, size_t size, size_t nmemb, void *cls) | |||
1257 | * from curl | 1257 | * from curl |
1258 | * | 1258 | * |
1259 | * @param cls closure | 1259 | * @param cls closure |
1260 | * @param tc task context | ||
1261 | */ | 1260 | */ |
1262 | static void | 1261 | static void |
1263 | curl_task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 1262 | curl_task_download (void *cls); |
1264 | 1263 | ||
1265 | 1264 | ||
1266 | /** | 1265 | /** |
@@ -1328,11 +1327,9 @@ curl_download_prepare () | |||
1328 | * Task that is run when we are ready to receive more data from curl. | 1327 | * Task that is run when we are ready to receive more data from curl. |
1329 | * | 1328 | * |
1330 | * @param cls closure, NULL | 1329 | * @param cls closure, NULL |
1331 | * @param tc task context | ||
1332 | */ | 1330 | */ |
1333 | static void | 1331 | static void |
1334 | curl_task_download (void *cls, | 1332 | curl_task_download (void *cls) |
1335 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1336 | { | 1333 | { |
1337 | int running; | 1334 | int running; |
1338 | int msgnum; | 1335 | int msgnum; |
@@ -1821,11 +1818,9 @@ kill_httpd (struct MhdHttpList *hd) | |||
1821 | * Task run whenever HTTP server is idle for too long. Kill it. | 1818 | * Task run whenever HTTP server is idle for too long. Kill it. |
1822 | * | 1819 | * |
1823 | * @param cls the `struct MhdHttpList *` | 1820 | * @param cls the `struct MhdHttpList *` |
1824 | * @param tc sched context | ||
1825 | */ | 1821 | */ |
1826 | static void | 1822 | static void |
1827 | kill_httpd_task (void *cls, | 1823 | kill_httpd_task (void *cls) |
1828 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1829 | { | 1824 | { |
1830 | struct MhdHttpList *hd = cls; | 1825 | struct MhdHttpList *hd = cls; |
1831 | 1826 | ||
@@ -1838,11 +1833,9 @@ kill_httpd_task (void *cls, | |||
1838 | * Task run whenever HTTP server operations are pending. | 1833 | * Task run whenever HTTP server operations are pending. |
1839 | * | 1834 | * |
1840 | * @param cls the `struct MhdHttpList *` of the daemon that is being run | 1835 | * @param cls the `struct MhdHttpList *` of the daemon that is being run |
1841 | * @param tc sched context | ||
1842 | */ | 1836 | */ |
1843 | static void | 1837 | static void |
1844 | do_httpd (void *cls, | 1838 | do_httpd (void *cls); |
1845 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
1846 | 1839 | ||
1847 | 1840 | ||
1848 | /** | 1841 | /** |
@@ -1920,11 +1913,9 @@ schedule_httpd (struct MhdHttpList *hd) | |||
1920 | * Task run whenever HTTP server operations are pending. | 1913 | * Task run whenever HTTP server operations are pending. |
1921 | * | 1914 | * |
1922 | * @param cls the `struct MhdHttpList` of the daemon that is being run | 1915 | * @param cls the `struct MhdHttpList` of the daemon that is being run |
1923 | * @param tc scheduler context | ||
1924 | */ | 1916 | */ |
1925 | static void | 1917 | static void |
1926 | do_httpd (void *cls, | 1918 | do_httpd (void *cls) |
1927 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1928 | { | 1919 | { |
1929 | struct MhdHttpList *hd = cls; | 1920 | struct MhdHttpList *hd = cls; |
1930 | 1921 | ||
@@ -2171,11 +2162,9 @@ lookup_ssl_httpd (const char* domain) | |||
2171 | * the SOCKS5 handshake). Clean up. | 2162 | * the SOCKS5 handshake). Clean up. |
2172 | * | 2163 | * |
2173 | * @param cls the `struct Socks5Request *` | 2164 | * @param cls the `struct Socks5Request *` |
2174 | * @param tc sched context | ||
2175 | */ | 2165 | */ |
2176 | static void | 2166 | static void |
2177 | timeout_s5r_handshake (void *cls, | 2167 | timeout_s5r_handshake (void *cls) |
2178 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
2179 | { | 2168 | { |
2180 | struct Socks5Request *s5r = cls; | 2169 | struct Socks5Request *s5r = cls; |
2181 | 2170 | ||
@@ -2245,11 +2234,9 @@ setup_data_transfer (struct Socks5Request *s5r) | |||
2245 | * Write data from buffer to socks5 client, then continue with state machine. | 2234 | * Write data from buffer to socks5 client, then continue with state machine. |
2246 | * | 2235 | * |
2247 | * @param cls the closure with the `struct Socks5Request` | 2236 | * @param cls the closure with the `struct Socks5Request` |
2248 | * @param tc scheduler context | ||
2249 | */ | 2237 | */ |
2250 | static void | 2238 | static void |
2251 | do_write (void *cls, | 2239 | do_write (void *cls) |
2252 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
2253 | { | 2240 | { |
2254 | struct Socks5Request *s5r = cls; | 2241 | struct Socks5Request *s5r = cls; |
2255 | ssize_t len; | 2242 | ssize_t len; |
@@ -2502,11 +2489,9 @@ clear_from_s5r_rbuf (struct Socks5Request *s5r, | |||
2502 | * Read data from incoming Socks5 connection | 2489 | * Read data from incoming Socks5 connection |
2503 | * | 2490 | * |
2504 | * @param cls the closure with the `struct Socks5Request` | 2491 | * @param cls the closure with the `struct Socks5Request` |
2505 | * @param tc the scheduler context | ||
2506 | */ | 2492 | */ |
2507 | static void | 2493 | static void |
2508 | do_s5r_read (void *cls, | 2494 | do_s5r_read (void *cls) |
2509 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
2510 | { | 2495 | { |
2511 | struct Socks5Request *s5r = cls; | 2496 | struct Socks5Request *s5r = cls; |
2512 | const struct Socks5ClientHelloMessage *c_hello; | 2497 | const struct Socks5ClientHelloMessage *c_hello; |
@@ -2514,8 +2499,10 @@ do_s5r_read (void *cls, | |||
2514 | const struct Socks5ClientRequestMessage *c_req; | 2499 | const struct Socks5ClientRequestMessage *c_req; |
2515 | ssize_t rlen; | 2500 | ssize_t rlen; |
2516 | size_t alen; | 2501 | size_t alen; |
2502 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
2517 | 2503 | ||
2518 | s5r->rtask = NULL; | 2504 | s5r->rtask = NULL; |
2505 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
2519 | if ( (NULL != tc->read_ready) && | 2506 | if ( (NULL != tc->read_ready) && |
2520 | (GNUNET_NETWORK_fdset_isset (tc->read_ready, s5r->sock)) ) | 2507 | (GNUNET_NETWORK_fdset_isset (tc->read_ready, s5r->sock)) ) |
2521 | { | 2508 | { |
@@ -2721,17 +2708,18 @@ do_s5r_read (void *cls, | |||
2721 | * @param tc the scheduler context | 2708 | * @param tc the scheduler context |
2722 | */ | 2709 | */ |
2723 | static void | 2710 | static void |
2724 | do_accept (void *cls, | 2711 | do_accept (void *cls) |
2725 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
2726 | { | 2712 | { |
2727 | struct GNUNET_NETWORK_Handle *lsock = cls; | 2713 | struct GNUNET_NETWORK_Handle *lsock = cls; |
2728 | struct GNUNET_NETWORK_Handle *s; | 2714 | struct GNUNET_NETWORK_Handle *s; |
2729 | struct Socks5Request *s5r; | 2715 | struct Socks5Request *s5r; |
2716 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
2730 | 2717 | ||
2731 | if (lsock == lsock4) | 2718 | if (lsock == lsock4) |
2732 | ltask4 = NULL; | 2719 | ltask4 = NULL; |
2733 | else | 2720 | else |
2734 | ltask6 = NULL; | 2721 | ltask6 = NULL; |
2722 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
2735 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 2723 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
2736 | return; | 2724 | return; |
2737 | if (lsock == lsock4) | 2725 | if (lsock == lsock4) |
@@ -2769,11 +2757,9 @@ do_accept (void *cls, | |||
2769 | * Task run on shutdown | 2757 | * Task run on shutdown |
2770 | * | 2758 | * |
2771 | * @param cls closure | 2759 | * @param cls closure |
2772 | * @param tc task context | ||
2773 | */ | 2760 | */ |
2774 | static void | 2761 | static void |
2775 | do_shutdown (void *cls, | 2762 | do_shutdown (void *cls) |
2776 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
2777 | { | 2763 | { |
2778 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 2764 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
2779 | "Shutting down...\n"); | 2765 | "Shutting down...\n"); |