summaryrefslogtreecommitdiff
path: root/gweb
diff options
context:
space:
mode:
authorNishant Chaprana <n.chaprana@samsung.com>2019-07-04 17:41:09 +0530
committerNishant Chaprana <n.chaprana@samsung.com>2019-07-04 17:41:17 +0530
commit6b2381a2adabea7d8309ff158ef675ff88184305 (patch)
tree2c9b2bb6d8b214acc18b8e784e6841f468a5a040 /gweb
parent9362752a471a5c892d679548fbf2828d5fc5684b (diff)
downloadconnman-6b2381a2adabea7d8309ff158ef675ff88184305.tar.gz
connman-6b2381a2adabea7d8309ff158ef675ff88184305.tar.bz2
connman-6b2381a2adabea7d8309ff158ef675ff88184305.zip
Imported Upstream version 1.37upstream/1.37
Change-Id: Ib5957e7ee3a9315ee86a331189bc3e9e71751ee8 Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
Diffstat (limited to 'gweb')
-rw-r--r--gweb/giognutls.c4
-rw-r--r--gweb/gresolv.c8
-rw-r--r--gweb/gresolv.h1
3 files changed, 9 insertions, 4 deletions
diff --git a/gweb/giognutls.c b/gweb/giognutls.c
index 09dc9e72..b5c476cb 100644
--- a/gweb/giognutls.c
+++ b/gweb/giognutls.c
@@ -304,7 +304,7 @@ static gboolean g_io_gnutls_dispatch(GSource *source, GSourceFunc callback,
gpointer user_data)
{
GIOGnuTLSWatch *watch = (GIOGnuTLSWatch *) source;
- GIOFunc func = (GIOFunc) callback;
+ GIOFunc func = (GIOFunc) (void (*) (void)) callback;
GIOCondition condition = watch->pollfd.revents;
DBG("source %p condition %u", source, condition);
@@ -421,7 +421,7 @@ GIOChannel *g_io_channel_gnutls_new(int fd)
DBG("");
- gnutls_channel = g_new(GIOGnuTLSChannel, 1);
+ gnutls_channel = g_new0(GIOGnuTLSChannel, 1);
channel = (GIOChannel *) gnutls_channel;
diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index 8a51a9f6..38a554e0 100644
--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -28,6 +28,7 @@
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
+#include <stdio.h>
#include <resolv.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -511,7 +512,7 @@ static void sort_and_return_results(struct resolv_lookup *lookup)
status = lookup->ipv4_status;
}
- debug(lookup->resolv, "lookup %p received %d results", lookup, n);
+ debug(lookup->resolv, "lookup %p received %d results", lookup, n-1);
g_queue_remove(lookup->resolv->lookup_queue, lookup);
destroy_lookup(lookup);
@@ -679,7 +680,10 @@ static void parse_response(struct resolv_nameserver *nameserver,
switch (rcode) {
case ns_r_noerror:
- status = G_RESOLV_RESULT_STATUS_SUCCESS;
+ if (count > 0)
+ status = G_RESOLV_RESULT_STATUS_SUCCESS;
+ else
+ status = G_RESOLV_RESULT_STATUS_NO_ANSWER;
break;
case ns_r_formerr:
status = G_RESOLV_RESULT_STATUS_FORMAT_ERROR;
diff --git a/gweb/gresolv.h b/gweb/gresolv.h
index fac14f54..5e82c168 100644
--- a/gweb/gresolv.h
+++ b/gweb/gresolv.h
@@ -44,6 +44,7 @@ typedef enum {
G_RESOLV_RESULT_STATUS_NAME_ERROR,
G_RESOLV_RESULT_STATUS_NOT_IMPLEMENTED,
G_RESOLV_RESULT_STATUS_REFUSED,
+ G_RESOLV_RESULT_STATUS_NO_ANSWER,
} GResolvResultStatus;
typedef void (*GResolvResultFunc)(GResolvResultStatus status,