From: Marcel Holtmann Date: Sat, 30 Oct 2010 13:42:47 +0000 (+0200) Subject: Use an unbuffered channel for HTTP and HTTPS transports X-Git-Tag: 2.0_alpha~2240 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9533b9b43154b23177e3b4f57ca977cfe4103cb0;p=framework%2Fconnectivity%2Fconnman.git Use an unbuffered channel for HTTP and HTTPS transports --- diff --git a/gweb/gweb.c b/gweb/gweb.c index 3bd2624..9103df9 100644 --- a/gweb/gweb.c +++ b/gweb/gweb.c @@ -263,6 +263,9 @@ static int connect_session_transport(struct web_session *session) return -ENOMEM; } + g_io_channel_set_encoding(session->transport_channel, NULL, NULL); + g_io_channel_set_buffered(session->transport_channel, FALSE); + g_io_channel_set_close_on_unref(session->transport_channel, TRUE); session->transport_watch = g_io_add_watch(session->transport_channel, @@ -276,7 +279,7 @@ static void start_request(struct web_session *session) { GString *buf; gchar *str; - gsize bytes_written; + gsize count, bytes_written; GIOStatus status; debug(session->web, "request %s from %s", @@ -290,8 +293,12 @@ static void start_request(struct web_session *session) g_string_append(buf, "\r\n"); str = g_string_free(buf, FALSE); + count = strlen(str); + + debug(session->web, "bytes to write %zu", count); + status = g_io_channel_write_chars(session->transport_channel, - str, strlen(str), &bytes_written, NULL); + str, count, &bytes_written, NULL); debug(session->web, "status %u bytes written %zu", status, bytes_written);