gnunet-svn
[Top][All Lists]
Advanced

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

[taler-quickjs-tart] branch master updated: TALER_set_native_http_client


From: gnunet
Subject: [taler-quickjs-tart] branch master updated: TALER_set_native_http_client_implementation
Date: Wed, 28 Feb 2024 12:26:16 +0100

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

marc-stibane pushed a commit to branch master
in repository quickjs-tart.

The following commit(s) were added to refs/heads/master by this push:
     new f59b2d9  TALER_set_native_http_client_implementation
f59b2d9 is described below

commit f59b2d9567a16ab31b8ad8c138c0eef226caf7d4
Author: Marc Stibane <marc@taler.net>
AuthorDate: Wed Feb 28 12:26:05 2024 +0100

    TALER_set_native_http_client_implementation
---
 taler_wallet_core_lib.c              | 16 ++++++++++++++++
 taler_wallet_core_lib_preprocessed.h | 14 ++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/taler_wallet_core_lib.c b/taler_wallet_core_lib.c
index 1cfaf5c..ecf131c 100644
--- a/taler_wallet_core_lib.c
+++ b/taler_wallet_core_lib.c
@@ -334,3 +334,19 @@ TALER_set_http_client_implementation(struct 
TALER_WALLET_Instance *twi,
 {
   twi->http_impl = impl;
 }
+
+#pragma mark -
+void
+TALER_set_native_http_client_implementation(struct TALER_WALLET_Instance *twi,
+                                            JSHttpReqCreateFn req_create,
+                                            JSHttpReqCancelFn req_cancel,
+                                            void *handler_p)
+{
+    // will (and should!) crash if this tiny malloc fails
+    struct JSHttpClientImplementation *impl = malloc(sizeof *impl);
+    impl->cls = handler_p;
+    impl->req_create = req_create;
+    impl->req_cancel = req_cancel;
+    twi->http_impl = impl;
+    // no need to free impl, because this is a singleton
+}
diff --git a/taler_wallet_core_lib_preprocessed.h 
b/taler_wallet_core_lib_preprocessed.h
index f8872c8..c1159be 100644
--- a/taler_wallet_core_lib_preprocessed.h
+++ b/taler_wallet_core_lib_preprocessed.h
@@ -372,4 +372,18 @@ void
 TALER_set_http_client_implementation(struct TALER_WALLET_Instance *twi,
                                      struct JSHttpClientImplementation *impl);
 
+#pragma mark -
+/**
+ * Set the native HTTP client implementation to be used by the wallet.
+ *
+ * @param twi wallet-core instance
+ * @param req_create HTTP client implementation
+ * @param req_cancel HTTP client implementation
+ */
+void
+TALER_set_native_http_client_implementation(struct TALER_WALLET_Instance *twi,
+                                            JSHttpReqCreateFn req_create,
+                                            JSHttpReqCancelFn req_cancel,
+                                            void *handler_p);
+
 #endif /*_TALER_WALLET_LIB_H */

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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