#ifdef WEARABLE
static bool g_internet_supported = true;
#endif
+static bool g_use_proxy = false;
void __transaction_header_cb(http_transaction_h transaction, char *header, size_t header_len, void *user_data)
{
http_transaction_set_aborted_cb(transaction, __transaction_aborted_cb, NULL);
}
+void _get_proxy_info(void)
+{
+ connection_h connection = NULL;
+ char *proxy_addr = NULL;
+
+ if (connection_create(&connection) < 0)
+ return;
+
+ if (connection_get_proxy(connection, CONNECTION_ADDRESS_FAMILY_IPV4, &proxy_addr) < 0)
+ return;
+
+ if (proxy_addr) {
+ g_use_proxy = true;
+ free(proxy_addr);
+ }
+}
/**
* @function utc_network_http_startup
#ifdef WEARABLE
system_info_get_platform_bool("http://tizen.org/feature/network.internet", &g_internet_supported);
#endif
+ _get_proxy_info();
+
if (!is_init) {
ret = http_init();
if (ret != HTTP_ERROR_NONE)
g_main_loop_run(g_pMainLoop);
g_pMainLoop = NULL;
- assert_eq(g_CallbackRet, HTTP_ERROR_COULDNT_RESOLVE_HOST);
+ if (g_use_proxy) {
+ // proxy server might not return response when URL isn't valid.
+ if (g_CallbackRet == HTTP_ERROR_OPERATION_FAILED
+ || g_CallbackRet == HTTP_ERROR_COULDNT_RESOLVE_HOST)
+ return 0;
+ else
+ return 1;
+ } else {
+ assert_eq(g_CallbackRet, HTTP_ERROR_COULDNT_RESOLVE_HOST);
+ }
return 0;
}