diff options
author | Florian Dold <florian@dold.me> | 2024-02-23 15:54:29 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-02-26 21:06:41 +0100 |
commit | 47fc98540143afee8f77c6298fdeb3c0b0d7b6ec (patch) | |
tree | 868d9b582cd9745c30161f5e6753c945d8d49333 /taler_wallet_core_lib.c | |
parent | 0595d6b972a4c3a9f26c93ced206a82a403146de (diff) | |
download | quickjs-tart-47fc98540143afee8f77c6298fdeb3c0b0d7b6ec.tar.gz quickjs-tart-47fc98540143afee8f77c6298fdeb3c0b0d7b6ec.tar.bz2 quickjs-tart-47fc98540143afee8f77c6298fdeb3c0b0d7b6ec.zip |
native http lib interfacedev/dold/native-http
Diffstat (limited to 'taler_wallet_core_lib.c')
-rw-r--r-- | taler_wallet_core_lib.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/taler_wallet_core_lib.c b/taler_wallet_core_lib.c index ae82358..a7c2898 100644 --- a/taler_wallet_core_lib.c +++ b/taler_wallet_core_lib.c @@ -52,6 +52,8 @@ struct TALER_WALLET_Instance TALER_WALLET_LogHandlerFn log_handler_f; void *log_handler_cls; + + struct JSHttpClientImplementation *http_impl; }; @@ -176,8 +178,14 @@ run(void *cls) wh->rt = JS_NewRuntime(); js_std_init_handlers(wh->rt); - wh->ctx = JS_NewCustomContext(wh->rt); + if (wh->http_impl) { + js_os_set_http_impl(wh->rt, wh->http_impl); + } else { + fprintf(stderr, "warning: no HTTP client implementation provided for wallet-core\n"); + } + + wh->ctx = JS_NewCustomContext(wh->rt); if (!wh->ctx) { fprintf(stderr, "qjs: cannot allocate JS context\n"); @@ -322,3 +330,10 @@ TALER_start_redirect_std(TALER_LogFn logfn, void *cls) pthread_detach(log_thr); return 0; } + +void +TALER_set_http_client_implementation(struct TALER_WALLET_Instance *instance, + struct JSHttpClientImplementation *impl) +{ + instance->http_impl = impl; +} |