#include <Elementary.h>
#include <locations.h>
+#include <net_connection.h>
#include "utils/logger.h"
#include "utils/config.h"
{
DBG("Inside send_push_data_to_server");
+ connection_h connection;
+ char *proxy_address = NULL;
+ int ret = 0;
+
push_view *this = NULL;
this = (push_view*)user_data;
RETM_IF(NULL == this, "view is NULL");
char* server = push_service_get_server_address(this->reg_id);
DBG("Server Address: %s", server);
- curl_err = curl_easy_setopt(this->curl_handle, CURLOPT_URL, push_service_get_server_address(this->reg_id));
+ curl_err = curl_easy_setopt(this->curl_handle, CURLOPT_URL, server);
RETM_IF(curl_err != CURLE_OK, "curl_easy_setopt - Adding CURLOPT_URL Failed %d", curl_err);
curl_easy_setopt(this->curl_handle, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(this->curl_handle, CURLOPT_WRITEFUNCTION, _curl_response_cb);
curl_easy_setopt(this->curl_handle, CURLOPT_WRITEDATA, user_data);
+ curl_easy_setopt(this->curl_handle, CURLOPT_CONNECTTIMEOUT_MS, 15000);
+ curl_easy_setopt(this->curl_handle, CURLOPT_PROXYPORT, 8090);
+
+ ret = connection_create(&connection);
+ if (CONNECTION_ERROR_NONE != ret) {
+ DBG("fail to create conn_handle[%d]", ret);
+ return;
+ }
+
+ ret = connection_get_proxy(connection, CONNECTION_ADDRESS_FAMILY_IPV4, &proxy_address);
+ if (ret != CONNECTION_ERROR_NONE) {
+ DBG("Fail to get proxy[%d]", ret);
+ if (proxy_address) {
+ free(proxy_address);
+ proxy_address = NULL;
+ }
+ } else {
+ if (proxy_address != NULL && strlen(proxy_address) != 0) {
+ DBG("Proxy Address : [%s]", proxy_address);
+ curl_easy_setopt(this->curl_handle, CURLOPT_PROXY, proxy_address);
+ }
+ }
+
+ if (connection) {
+ connection_destroy(connection);
+ connection = NULL;
+ }
// lets send curl http request
curl_err = curl_easy_perform(this->curl_handle);
// Determine RQM server
if (strncmp(reg_id, "00", 2) == 0) {
server_address =
- "https://useast.push.samsungosp.com:8088/spp/pns/api/push";
+ "https://useast.push.samsungosp.com:8090/spp/pns/api/push";
} else if (strncmp(reg_id, "01", 2) == 0) {
server_address =
- "https://uswest.push.samsungosp.com:8088/spp/pns/api/push";
+ "https://uswest.push.samsungosp.com:8090/spp/pns/api/push";
} else if (strncmp(reg_id, "02", 2) == 0) {
server_address =
- "https://apsoutheast.push.samsungosp.com:8088/spp/pns/api/push";
+ "https://apsoutheast.push.samsungosp.com:8090/spp/pns/api/push";
} else if (strncmp(reg_id, "03", 2) == 0) {
server_address =
- "https://euwest.push.samsungosp.com:8088/spp/pns/api/push";
+ "https://euwest.push.samsungosp.com:8090/spp/pns/api/push";
} else if (strncmp(reg_id, "04", 2) == 0) {
server_address =
- "https://apnortheast.push.samsungosp.com:8088/spp/pns/api/push";
+ "https://apnortheast.push.samsungosp.com:8090/spp/pns/api/push";
} else if (strncmp(reg_id, "05", 2) == 0) {
server_address =
- "https://apkorea.push.samsungosp.com:8088/spp/pns/api/push";
+ "https://apkorea.push.samsungosp.com:8090/spp/pns/api/push";
} else if (strncmp(reg_id, "06", 2) == 0) {
server_address =
- "https://apchina.push.samsungosp.com.cn:8088/spp/pns/api/push";
+ "https://apchina.push.samsungosp.com.cn:8090/spp/pns/api/push";
} else {
DBG("REG_ID has a wrong prefix");
}