From 9c27003131039a051b4c5ced40ca180312eca29b Mon Sep 17 00:00:00 2001 From: Seonah Moon Date: Wed, 19 Sep 2018 13:09:40 +0900 Subject: [PATCH] Set dns timeout and tries for TV Change-Id: Id46d468d2dcf15ec39dabf45f5edf077a260f6f7 --- lib/asyn-ares.c | 19 +++++++++++++++++++ packaging/curl.spec | 4 +--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index aa581a4..3a7a8ff 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -80,6 +80,11 @@ #define HAVE_CARES_CALLBACK_TIMEOUTS 1 #endif +#ifdef TIZEN_TV_EXT +#define DEFAULT_TIMEOUT 3000 /* ms */ +#define DEFAULT_TRIES 1 +#endif + /* The last 3 #include files should be in this order */ #include "curl_printf.h" #include "curl_memory.h" @@ -128,7 +133,21 @@ void Curl_resolver_global_cleanup(void) */ CURLcode Curl_resolver_init(void **resolver) { +#ifndef TIZEN_TV_EXT int status = ares_init((ares_channel*)resolver); +#else + int status; + struct ares_options options; + int optmask = 0; + + options.timeout = DEFAULT_TIMEOUT; + optmask |= ARES_OPT_TIMEOUTMS; + + options.tries = DEFAULT_TRIES; + optmask |= ARES_OPT_TRIES; + + status = ares_init_options((ares_channel*)resolver, &options, optmask); +#endif if(status != ARES_SUCCESS) { if(status == ARES_ENOMEM) return CURLE_OUT_OF_MEMORY; diff --git a/packaging/curl.spec b/packaging/curl.spec index 645939e..62ea82d 100644 --- a/packaging/curl.spec +++ b/packaging/curl.spec @@ -71,10 +71,8 @@ export CPPFLAGS="-DHAVE_PK11_CREATEGENERICOBJECT" CFLAGS+=" -fstack-protector-strong -Wl,-z,relro -D_FORTIFY_SOURCE=2 -fPIE -pie" %if "%{tizen_profile_name}" == "tv" CFLAGS+=" -DTIZEN_TV_EXT" -%reconfigure --without-nss --without-gnutls --with-openssl --enable-ipv6 \ -%else -%reconfigure --without-nss --without-gnutls --with-openssl --enable-ipv6 \ %endif +%reconfigure --without-nss --without-gnutls --with-openssl --enable-ipv6 \ --with-ca-path==/etc/ssl/certs \ --with-ca-bundle=/etc/ssl/ca-bundle.pem \ --with-icu-uc \ -- 2.7.4