From 7a31cdc9a9508a7c04ed05a306a6764cbfcf39d3 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 19 May 2015 09:05:03 +0200 Subject: [PATCH] proxy: Minor cleanup for first byte case We treat this mostly the same as the !authenticated case rather than a completely different case --- xdg-app-proxy.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/xdg-app-proxy.c b/xdg-app-proxy.c index 67eb4043..07db11c3 100644 --- a/xdg-app-proxy.c +++ b/xdg-app-proxy.c @@ -2071,22 +2071,15 @@ side_in_cb (GSocket *socket, GIOCondition condition, gpointer user_data) if (buffer_read (side, buffer, socket) || !client->authenticated) { - if (!side->got_first_byte) - { - if (buffer->pos > 0) - { - buffer->send_credentials = TRUE; - buffer->size = buffer->pos; - got_buffer_from_side (side, buffer); - side->got_first_byte = TRUE; - } - else - buffer_free (buffer); - } - else if (!client->authenticated) + if (!client->authenticated) { if (buffer->pos > 0) { + if (!side->got_first_byte) + { + buffer->send_credentials = TRUE; + side->got_first_byte = TRUE; + } buffer->size = buffer->pos; got_buffer_from_side (side, buffer); }