Set dns timeout and tries for TV 85/189585/3 accepted/tizen/5.0/base/20181101.091223 accepted/tizen/base/20180921.230933 submit/tizen_5.0_base/20181101.000001 submit/tizen_base/20180920.024635
authorSeonah Moon <seonah1.moon@samsung.com>
Wed, 19 Sep 2018 04:09:40 +0000 (13:09 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Thu, 20 Sep 2018 02:15:43 +0000 (11:15 +0900)
Change-Id: Id46d468d2dcf15ec39dabf45f5edf077a260f6f7

lib/asyn-ares.c
packaging/curl.spec

index aa581a4..3a7a8ff 100644 (file)
 #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;
index 645939e..62ea82d 100644 (file)
@@ -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 \