summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJuan Pablo Ugarte <juanpablougarte@gmail.com>2014-03-25 12:39:08 -0300
committerJuan Pablo Ugarte <juanpablougarte@gmail.com>2014-03-25 12:39:42 -0300
commita069e1d13be1af839fd3ddc6cf299c5631610b16 (patch)
tree0a9290bbe8638f2bdb3c5581241c5a412188f7fe /src
parent71395db39a5a325a06d88bdf49cc549faa2072b0 (diff)
downloadglade-a069e1d13be1af839fd3ddc6cf299c5631610b16.tar.gz
Fixed Bug 727014 "32 bit builds fail with -Werror=format-security"
Diffstat (limited to 'src')
-rw-r--r--src/glade-http.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/glade-http.c b/src/glade-http.c
index ebd217fe..3e1a187a 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,