[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r37104 - in gnunet: po src/curl src/include
From: |
gnunet |
Subject: |
[GNUnet-SVN] r37104 - in gnunet: po src/curl src/include |
Date: |
Mon, 2 May 2016 02:23:28 +0200 |
Author: grothoff
Date: 2016-05-02 02:23:27 +0200 (Mon, 02 May 2016)
New Revision: 37104
Modified:
gnunet/po/POTFILES.in
gnunet/src/curl/curl.c
gnunet/src/include/gnunet_curl_lib.h
Log:
API update to fix #4479
Modified: gnunet/po/POTFILES.in
===================================================================
--- gnunet/po/POTFILES.in 2016-04-30 08:24:42 UTC (rev 37103)
+++ gnunet/po/POTFILES.in 2016-05-02 00:23:27 UTC (rev 37104)
@@ -429,7 +429,6 @@
src/util/crypto_rsa.c
src/util/crypto_symmetric.c
src/util/disk.c
-src/util/disk_iterator.c
src/util/getopt.c
src/util/getopt_helpers.c
src/util/gnunet-config.c
Modified: gnunet/src/curl/curl.c
===================================================================
--- gnunet/src/curl/curl.c 2016-04-30 08:24:42 UTC (rev 37103)
+++ gnunet/src/curl/curl.c 2016-05-02 00:23:27 UTC (rev 37104)
@@ -159,6 +159,16 @@
*/
struct curl_slist *json_header;
+ /**
+ * Function we need to call whenever the event loop's
+ * socket set changed.
+ */
+ GNUNET_CURL_RescheduleCallback cb;
+
+ /**
+ * Closure for @e cb.
+ */
+ void *cb_cls;
};
@@ -166,10 +176,13 @@
* Initialise this library. This function should be called before using any of
* the following functions.
*
+ * @param cb function to call when rescheduling is required
+ * @param cb_cls closure for @a cb
* @return library context
*/
struct GNUNET_CURL_Context *
-GNUNET_CURL_init ()
+GNUNET_CURL_init (GNUNET_CURL_RescheduleCallback cb,
+ void *cb_cls)
{
struct GNUNET_CURL_Context *ctx;
CURLM *multi;
@@ -194,6 +207,8 @@
return NULL;
}
ctx = GNUNET_new (struct GNUNET_CURL_Context);
+ ctx->cb = cb;
+ ctx->cb_cls = cb_cls;
ctx->multi = multi;
ctx->share = share;
GNUNET_assert (NULL != (ctx->json_header =
@@ -316,6 +331,7 @@
GNUNET_CONTAINER_DLL_insert (ctx->jobs_head,
ctx->jobs_tail,
job);
+ ctx->cb (ctx->cb_cls);
return job;
}
Modified: gnunet/src/include/gnunet_curl_lib.h
===================================================================
--- gnunet/src/include/gnunet_curl_lib.h 2016-04-30 08:24:42 UTC (rev
37103)
+++ gnunet/src/include/gnunet_curl_lib.h 2016-05-02 00:23:27 UTC (rev
37104)
@@ -38,13 +38,28 @@
/**
+ * Function called by the context to ask for the event loop to be
+ * rescheduled, that is the application should call
+ * #GNUNET_CURL_get_select_info() as the set of sockets we care about
+ * just changed.
+ *
+ * @param cls closure
+ */
+typedef void
+(*GNUNET_CURL_RescheduleCallback)(void *cls);
+
+
+/**
* Initialise this library. This function should be called before using any of
* the following functions.
*
+ * @param cb function to call when rescheduling is required
+ * @param cb_cls closure for @a cb
* @return library context
*/
struct GNUNET_CURL_Context *
-GNUNET_CURL_init (void);
+GNUNET_CURL_init (GNUNET_CURL_RescheduleCallback cb,
+ void *cb_cls);
/**
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r37104 - in gnunet: po src/curl src/include,
gnunet <=