[systemd-devel] systemd-journal-remote
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Tue Mar 18 05:51:29 PDT 2014
On Mon, Mar 17, 2014 at 11:00:32PM -0700, David Timothy Strauss wrote:
> On Sun, Mar 16, 2014 at 11:29 PM, Zbigniew Jędrzejewski-Szmek
> <zbyszek at in.waw.pl> wrote:
> > Curl requires the whole file to be exported first, which isn't great,
> > because it wants to give the content size in the header. I'm note
> > sure if it is possible to tell it to not do that.
>
> I'm think you just need to implement your own function to use with
> CURLOPT_READFUNCTION and set a chunked encoding header [1] instead of
> giving libcurl an actual file to upload. You can return zero when
> you're done sending everything you want to send.
>
> [1] http://curl.haxx.se/libcurl/c/post-callback.html
Yeah, actually it works even without a callback, since curl is happy
to read froma FILE* by itself. It turns out that (in contradiction to
what the documentantion says), it is necessary to turn on chunked
transfer encoding explicitly, and then "streaming" uploads work great.
Some more care is necessary to handle timeouts, and I'm now working on
that.
Zbyszek
More information about the systemd-devel
mailing list