[glade/glade-3-18] Fixed Bug 727014 "32 bit builds fail with -Werror=format-security"



commit 376e7ed394f5eb9f48d2d76632729eda22a8fca0
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Tue Mar 25 12:39:08 2014 -0300

    Fixed Bug 727014 "32 bit builds fail with -Werror=format-security"

 src/glade-http.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/glade-http.c b/src/glade-http.c
index ebd217f..3e1a187 100644
--- a/src/glade-http.c
+++ b/src/glade-http.c
@@ -133,11 +133,12 @@ static void
 on_read_ready (GObject *source, GAsyncResult *res, gpointer data)
 {
   GladeHTTPPrivate *priv = GLADE_HTTP (data)->priv;
+  GError *error = NULL;
   gssize bytes_read;
 
   glade_http_emit_status (data, GLADE_HTTP_RECEIVING, NULL);
 
-  bytes_read = g_input_stream_read_finish (G_INPUT_STREAM (source), res, NULL);
+  bytes_read = g_input_stream_read_finish (G_INPUT_STREAM (source), res, &error);
   
   if (bytes_read > 0)
     {
@@ -157,8 +158,8 @@ on_read_ready (GObject *source, GAsyncResult *res, gpointer data)
     }
   else if (bytes_read < 0)
     {
-      /* Read error */
-      g_message ("g_input_stream_read_finish error");
+      glade_http_emit_status (data, GLADE_HTTP_ERROR, error);
+      g_error_free (error);
       return;
     }
 
@@ -176,6 +177,11 @@ on_write_ready (GObject *source, GAsyncResult *res, gpointer data)
 
   count = g_output_stream_write_finish (G_OUTPUT_STREAM (source), res, &error);
 
+  if (error == NULL && priv->data->len != count)
+    error = g_error_new (G_IO_ERROR, G_IO_ERROR_FAILED, 
+                         "Error sending data data to %s", 
+                         priv->host);
+
   if (error)
     {
       glade_http_emit_status (data, GLADE_HTTP_ERROR, error);
@@ -183,12 +189,6 @@ on_write_ready (GObject *source, GAsyncResult *res, gpointer data)
       return;
     }
 
-  if (priv->data->len != count)
-    {
-      g_warning ("priv->data_size = %ld, write = %ld", priv->data->len, count);
-      return;
-    }
-
   glade_http_emit_status (data, GLADE_HTTP_WAITING, NULL);
   g_input_stream_read_async (g_io_stream_get_input_stream (G_IO_STREAM (priv->connection)),
                              priv->response_buffer, HTTP_BUFFER_SIZE,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]