diff options
| author | Andreas Fankhauser hiddenalpha.ch | 2025-10-15 23:57:33 +0200 |
|---|---|---|
| committer | Andreas Fankhauser hiddenalpha.ch | 2025-10-15 23:57:33 +0200 |
| commit | a50aacc2b61d451cf6dad329eb1a8b0af679aa7b (patch) | |
| tree | c762e5f9227d26d24e1effb9062166d42e4b7ed4 /include/qntan/Qntan.h | |
| parent | 81331396f76c316a35e217505ab55f489c163f2c (diff) | |
| download | Qntan-a50aacc2b61d451cf6dad329eb1a8b0af679aa7b.tar.gz Qntan-a50aacc2b61d451cf6dad329eb1a8b0af679aa7b.zip | |
HttpClient thinker.
Diffstat (limited to 'include/qntan/Qntan.h')
| -rw-r--r-- | include/qntan/Qntan.h | 17 |
1 files changed, 13 insertions, 4 deletions
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 ); /**/ }; |
