From 1a991548988619350631713120a31c381fa8fa91 Mon Sep 17 00:00:00 2001 From: Ignacio Casal Quinteiro Date: Wed, 24 Jan 2018 11:31:52 +0100 Subject: [PATCH] gpollableoutputstream: document side effects of WOULD_BLOCK on D/TLS If the underlying transport is D/TLS the same data and data length is required to be sent on the next iteration when a WOULD_BLOCK happens. This is due to the fact that gnutls or openssl keep an internal state for the data. https://bugzilla.gnome.org/show_bug.cgi?id=792862 --- gio/gpollableoutputstream.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gio/gpollableoutputstream.c b/gio/gpollableoutputstream.c index 9bd6b8cd0..40c649f0d 100644 --- a/gio/gpollableoutputstream.c +++ b/gio/gpollableoutputstream.c @@ -178,6 +178,9 @@ g_pollable_output_stream_default_write_nonblocking (GPollableOutputStream *stre * may happen if you call this method after a source triggers due * to having been cancelled. * + * Also note that if %G_IO_ERROR_WOULD_BLOCK is returned some underlying + * transports like D/TLS require that you send the same @buffer and @count. + * * Virtual: write_nonblocking * Returns: the number of bytes written, or -1 on error (including * %G_IO_ERROR_WOULD_BLOCK).