diff options
author | Seonah Moon <seonah1.moon@samsung.com> | 2018-01-08 13:42:54 +0900 |
---|---|---|
committer | Seonah Moon <seonah1.moon@samsung.com> | 2018-01-08 13:43:31 +0900 |
commit | 9362752a471a5c892d679548fbf2828d5fc5684b (patch) | |
tree | 83c7d29a28556906938f5c2198d81e2d35f86f92 /gweb/gweb.c | |
parent | 22633ced6225d294ce8483efbf2b39ea0c0c1b65 (diff) | |
download | connman-9362752a471a5c892d679548fbf2828d5fc5684b.tar.gz connman-9362752a471a5c892d679548fbf2828d5fc5684b.tar.bz2 connman-9362752a471a5c892d679548fbf2828d5fc5684b.zip |
Imported Upstream version 1.35upstream/1.35
Change-Id: I174854914d9fd06a813270b57d1f7bc2bac63c6a
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
Diffstat (limited to 'gweb/gweb.c')
-rw-r--r-- | gweb/gweb.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/gweb/gweb.c b/gweb/gweb.c index f6828cf2..393afe0a 100644 --- a/gweb/gweb.c +++ b/gweb/gweb.c @@ -792,6 +792,9 @@ static void handle_multi_line(struct web_session *session) char *str; gchar *value; + if (!session->result.last_key) + return; + str = session->current_header->str; if (str[0] != ' ' && str[0] != '\t') @@ -1075,7 +1078,6 @@ static int connect_session_transport(struct web_session *session) session->addr->ai_addrlen) < 0) { if (errno != EINPROGRESS) { debug(session->web, "connect() %s", strerror(errno)); - close(sk); return -EIO; } } @@ -1346,8 +1348,7 @@ static guint do_request(GWeb *web, const char *url, g_free(session->address); session->address = g_strdup(host); } - session->address_action = g_timeout_add(0, already_resolved, - session); + session->address_action = g_idle_add(already_resolved, session); } else { session->resolv_action = g_resolv_lookup_hostname(web->resolv, host, resolv_result, session); @@ -1466,6 +1467,9 @@ GWebParser *g_web_parser_new(const char *begin, const char *end, { GWebParser *parser; + if (!begin || !end) + return NULL; + parser = g_try_new0(GWebParser, 1); if (!parser) return NULL; @@ -1474,12 +1478,6 @@ GWebParser *g_web_parser_new(const char *begin, const char *end, parser->begin_token = g_strdup(begin); parser->end_token = g_strdup(end); - - if (!parser->begin_token) { - g_free(parser); - return NULL; - } - parser->func = func; parser->user_data = user_data; |