From a50aacc2b61d451cf6dad329eb1a8b0af679aa7b Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser hiddenalpha.ch Date: Wed, 15 Oct 2025 23:57:33 +0200 Subject: HttpClient thinker. --- include/qntan/Qntan.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'include/qntan') diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h index 9cc79a3..9772de4 100644 --- a/include/qntan/Qntan.h +++ b/include/qntan/Qntan.h @@ -965,7 +965,7 @@ struct Qntan_XmlDec_Mentor { /* * WARN: HTTP IS EXPERMIMENTAL! DO NOT TRUST ANYTHING HERE! */ -struct Qntan_HttpClient_Req_Opts { +struct Qntan_HttpClient_Exchg_Opts { /* * Eg: 'GET', 'POST', ... */ char *mthd; @@ -1001,18 +1001,27 @@ struct Qntan_HttpClient_Req_Opts { /**/ }; -struct Qntan_HttpClient_Req { +struct Qntan_HttpClient_Exchg { /* + * Write another request body chunk. * @param flgs * 'flgs & 4' means this is the last buffer (aka EndOfMsg). */ void (*write)( struct Qntan_HttpClient**, req, void*buf, int len, int flgs, void(*onDone)(int,Qntan_Cls), Qntan_Cls ); + /* + * Set backpressure. This means that callbacks won't be called anymore. + * Events will be held back until resumed. */ + void (*pause)( struct Qntan_HttpClient**, ); + /* + * Reset backpressure. */ + void (*resume)( struct Qntan_HttpClient**, ); + /**/ }; struct Qntan_HttpClient { /**/ - void (*httpReq)( struct Qntan_HttpClient**, struct Qntan_HttpClient_Req_Opts*, - void(*onDone)(int,struct Qntan_HttpClient_Req**,Qntan_Cls), Qntan_Cls ); + void (*httpReq)( struct Qntan_HttpClient**, struct Qntan_HttpClient_Exchg_Opts*, + void(*onDone)(int,struct Qntan_HttpClient_Exchg**,Qntan_Cls), Qntan_Cls ); /**/ }; -- cgit v1.3.1