Fwd: libcurl read-like interface

2020-12-26 Thread XSLT2.0 via curl-library
"Loop inversion" I have fixed fcurl for the read scenario (made a PR). Made a basic fcurl_read/write_to_stdout program with fcurl. (extract)     while(!fcurl_eof(fcurl)) {         sz = fcurl_read(buf, 1, BUFSIZE, fcurl);         if (sz > 0) {             wsz = write(STDOUT_FILENO, buf, sz);    

Re: libcurl read-like interface

2020-12-26 Thread Daniel Stenberg via curl-library
On Sat, 26 Dec 2020, XSLT2.0 via curl-library wrote: You are not responding to the point about "control inversion" though. What am I to respond about that? It could use some polish to avoid risking the situation you describe. -- / daniel.haxx.se | Commercial curl support up to 24x7 is

Re: libcurl read-like interface

2020-12-26 Thread XSLT2.0 via curl-library
I beg your pardon if I made you angry Daniel, understating the "simplicity" of http! You are not responding to the point about "control inversion" though. Let me try to better explain what happens to a "read" with the current behaviour. You know it since you have coded it yourself in "fcurl".

Re: libcurl read-like interface

2020-12-26 Thread Daniel Stenberg via curl-library
On Sat, 26 Dec 2020, XSLT2.0 via curl-library wrote: Fortunately http/1.1 is simple enough, especially when downloading the "body" of a file (with Connection: close), you must admit that redoing what libcurl does here amounts to nothing. This could be one of the biggest understatements I've

Re: libcurl read-like interface

2020-12-26 Thread XSLT2.0 via curl-library
"Re-architecture"! Instead of "only critique", here is a (possible) proposition to do both "read-like" (efficiently) and the current stuff. There should be a definition of what *semantically* is "read" or "write" according to the request/use case. The "do/doing/done" internal phase, should

Re: libcurl read-like interface

2020-12-26 Thread XSLT2.0 via curl-library
True and duly noted Daniel! Fortunately http/1.1 is simple enough, especially when downloading the "body" of a file (with Connection: close), you must admit that redoing what libcurl does here amounts to nothing. I am even glad with avoiding a "full relay copy" (every bit of efficiency helps