gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: Expanding libgnunetcurl.


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: Expanding libgnunetcurl.
Date: Wed, 13 Jun 2018 18:39:18 +0200

This is an automated email from the git hooks/post-receive script.

marcello-stanisci pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 1a7fbccc8 Expanding libgnunetcurl.
1a7fbccc8 is described below

commit 1a7fbccc8b3fd6fc070d134892e736503286ef1b
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Jun 13 18:38:08 2018 +0200

    Expanding libgnunetcurl.
    
    Adding a method to let the user append
    a custom request header.
---
 src/curl/curl.c               | 19 +++++++++++++++++++
 src/include/gnunet_curl_lib.h | 11 +++++++++++
 2 files changed, 30 insertions(+)

diff --git a/src/curl/curl.c b/src/curl/curl.c
index 2d0b09d92..cdd39ab8e 100644
--- a/src/curl/curl.c
+++ b/src/curl/curl.c
@@ -448,6 +448,25 @@ download_get_result (struct DownloadBuffer *db,
 
 
 /**
+ * Add custom request header.
+ *
+ * @param ctx cURL context.
+ * @param header header string; will be given to the context AS IS.
+ * @return #GNUNET_OK if no errors occurred, #GNUNET_SYSERR otherwise.
+ */
+int
+GNUNET_CURL_append_header (struct GNUNET_CURL_Context *ctx,
+                           const char *header)
+{
+  ctx->json_header = curl_slist_append (ctx->json_header,
+                                        header);
+  if (NULL == ctx->json_header)
+    return GNUNET_SYSERR;
+
+  return GNUNET_OK;
+}
+
+/**
  * Run the main event loop for the Taler interaction.
  *
  * @param ctx the library context
diff --git a/src/include/gnunet_curl_lib.h b/src/include/gnunet_curl_lib.h
index 17e9aeea4..2b2442a52 100644
--- a/src/include/gnunet_curl_lib.h
+++ b/src/include/gnunet_curl_lib.h
@@ -99,6 +99,17 @@ GNUNET_CURL_get_select_info (struct GNUNET_CURL_Context *ctx,
 
 
 /**
+ * Add custom request header.
+ *
+ * @param ctx cURL context.
+ * @param header header string; will be given to the context AS IS.
+ * @return #GNUNET_OK if no errors occurred, #GNUNET_SYSERR otherwise.
+ */
+int
+GNUNET_CURL_append_header (struct GNUNET_CURL_Context *ctx,
+                           const char *header);
+
+/**
  * Run the main event loop for the CURL interaction.
  *
  * @param ctx the library context

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]