Commit aaf66c0b authored by Olivier Crête's avatar Olivier Crête Committed by Olivier Crête

test-send-recv: Write in a loop until blocked

We're not sure that our callback will be called again if
we haven't filled the pipe.
parent 52e0ce58
...@@ -1000,6 +1000,7 @@ write_stream_cb (GObject *pollable_stream, gpointer _user_data) ...@@ -1000,6 +1000,7 @@ write_stream_cb (GObject *pollable_stream, gpointer _user_data)
guint8 *buf = NULL; guint8 *buf = NULL;
gsize buf_len = 0; gsize buf_len = 0;
gssize len; gssize len;
for (;;) {
/* Initialise a receive buffer. */ /* Initialise a receive buffer. */
generate_buffer_to_transmit (data, test_data->transmitted_bytes, &buf, generate_buffer_to_transmit (data, test_data->transmitted_bytes, &buf,
...@@ -1024,10 +1025,11 @@ write_stream_cb (GObject *pollable_stream, gpointer _user_data) ...@@ -1024,10 +1025,11 @@ write_stream_cb (GObject *pollable_stream, gpointer _user_data)
/* Termination time? */ /* Termination time? */
if (test_data->transmitted_bytes == test_data->n_bytes) { if (test_data->transmitted_bytes == test_data->n_bytes) {
g_main_loop_quit (gsource_data->main_loop); g_main_loop_quit (gsource_data->main_loop);
return G_SOURCE_REMOVE; break;
}
} }
return G_SOURCE_CONTINUE; return G_SOURCE_REMOVE;
} }
static void static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment