Buy commercial curl support. We
help you work out your issues, debug your libcurl applications, use the API,
port to new platforms, add new features and more. With a team lead by the
curl founder Daniel himself.
Re: Minimizing buffering
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Stefan Eissing via curl-library <curl-library_at_lists.haxx.se>
Date: Mon, 16 Feb 2026 14:10:56 +0100
Hi,
> Am 16.02.2026 um 12:43 schrieb Peter Krefting via curl-library <curl-library_at_lists.haxx.se>:
>
> Hi!
>
> I am using libcurl to connect to a text/event-source resource (server-sent events), which outputs small line-based event data. When I connect to a HTTP end-point, the write callback gets called often enough for this to work, but when it is over HTTPS it buffers events (circa 200 bytes per event) for more than five seconds, even when I set the curl buffer size to the minimum (1024 bytes).
>
> Is there an additional HTTPS decryption buffer that I need to somehow override for this connection to get this working? I am using OpenSSL as the back-end.
libcurl does not buffer TLS records. It seems more likely that the buffering happens at the server. You should see this easily in wireshark when you look at the TLS records sent by the server. Use SSLKEYLOGFILE environment variable when invoking curl and provide that file to Wireshark for decryption.
Hope this helps,
Stefan
>
> --
> \\// Peter - http://www.softwolves.pp.se/
> --
> Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
> Etiquette: https://curl.se/mail/etiquette.html
Date: Mon, 16 Feb 2026 14:10:56 +0100
Hi,
> Am 16.02.2026 um 12:43 schrieb Peter Krefting via curl-library <curl-library_at_lists.haxx.se>:
>
> Hi!
>
> I am using libcurl to connect to a text/event-source resource (server-sent events), which outputs small line-based event data. When I connect to a HTTP end-point, the write callback gets called often enough for this to work, but when it is over HTTPS it buffers events (circa 200 bytes per event) for more than five seconds, even when I set the curl buffer size to the minimum (1024 bytes).
>
> Is there an additional HTTPS decryption buffer that I need to somehow override for this connection to get this working? I am using OpenSSL as the back-end.
libcurl does not buffer TLS records. It seems more likely that the buffering happens at the server. You should see this easily in wireshark when you look at the TLS records sent by the server. Use SSLKEYLOGFILE environment variable when invoking curl and provide that file to Wireshark for decryption.
Hope this helps,
Stefan
>
> --
> \\// Peter - http://www.softwolves.pp.se/
> --
> Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
> Etiquette: https://curl.se/mail/etiquette.html
-- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.htmlReceived on 2026-02-16