MSG_DEBUG("simIdList[0] [%d]", simIdList[0]);
- dataSize += ((sizeof(int)*size) + 1);
+ dataSize += ((sizeof(int))*(size + 1));
/* composing command */
int cmdSize = sizeof(MSG_CMD_S) + dataSize; /* cmd type, MSG_MESSAGE_INFO_S */
class MsgCndVar
{
public:
- MsgCndVar() { pthread_cond_init(&c, 0); }
+ MsgCndVar() {
+ pthread_condattr_t attr;
+ pthread_condattr_init(&attr);
+ pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
+ pthread_cond_init(&c, &attr);
+ pthread_condattr_destroy(&attr);
+ }
~MsgCndVar() { pthread_cond_destroy(&c); }
void wait(pthread_mutex_t* m) { pthread_cond_wait(&c, m); }
int timedwait(pthread_mutex_t* m, int sec)
{
- struct timeval now = {0};
struct timespec timeout = {0};
- gettimeofday(&now, NULL);
- timeout.tv_sec = now.tv_sec+sec;
- timeout.tv_nsec = now.tv_usec;
+ clock_gettime(CLOCK_MONOTONIC, &timeout);
+ timeout.tv_sec += sec;
int retcode = pthread_cond_timedwait(&c, m, &timeout);
return retcode;
}
int getLatestMsgInfo(MSG_MGR_NOTI_INFO_S *noti_info, bool isForInstantMessage);
void setProperty(notification_h noti_h, MSG_MGR_NOTI_INFO_S *noti_info);
-void setTextDomain(notification_h noti_h, msg_mgr_notification_type_t noti_type);
+void setTextDomain(notification_h noti_h);
void setText(notification_h noti_h, MSG_MGR_NOTI_INFO_S *noti_info);
void setIcon(notification_h noti_h, MSG_MGR_NOTI_INFO_S *noti_info);
void setSoundAndVibration(notification_h noti_h, char *addressVal, bool bVoiceMail);
}
-void setTextDomain(notification_h noti_h, msg_mgr_notification_type_t noti_type)
+void setTextDomain(notification_h noti_h)
{
MSG_MGR_BEGIN();
setActiveProperty(noti_h, noti_info);
- setTextDomain(noti_h, noti_info->type);
+ setTextDomain(noti_h);
setActiveText(noti_h, noti_info);
setProperty(noti_h, noti_info);
- setTextDomain(noti_h, noti_info->type);
+ setTextDomain(noti_h);
setText(noti_h, noti_info);
} else if (noti_info.count > 1) {
gchar *cnt_string = g_strdup_printf("%i", noti_info.count);
- notiMsg = get_translate_text(MSG_APP_PACKAGE_NAME, MSG_APP_LOCALEDIR, NEW_MESSAGE);
+ notiMsg = get_translate_text(MSG_APP_PACKAGE_NAME, MSG_APP_LOCALEDIR, NEW_MESSAGES);
gchar *outString = g_strconcat(cnt_string, " ", notiMsg, NULL);
setNotiText(noti, NOTIFICATION_TEXT_TYPE_TITLE, outString, NULL);
setNotiText(noti, NOTIFICATION_TEXT_TYPE_CONTENT, noti_info.sender, NULL);
MSG_ERR("Failed connection_profile_get_cellular_home_url");
}
+ this->dns_address_list = (char *)calloc(1, 51);
+ for (int i = 1; i <= 2; i++) {
+ char *dns = NULL;
+ err = connection_profile_get_dns_address(profile, i, CONNECTION_ADDRESS_FAMILY_IPV4, &dns);
+ if (err != CONNECTION_ERROR_NONE) {
+ MSG_ERR("Failed connection_profile_get_cellular_home_url");
+ }
+
+ if (dns != NULL) {
+ MSG_INFO("dns [%s]", dns);
+ if (g_strcmp0(dns, "0.0.0.0")) {
+ if (!(strlen(this->dns_address_list) > 1)) {
+ snprintf(this->dns_address_list, 50, "%s", dns);
+ } else {
+ snprintf(this->dns_address_list + strlen(this->dns_address_list ), 50 - strlen(this->dns_address_list ), ",%s", dns);
+ }
+ }
+ MSG_FREE(dns);
+ }
+ MSG_INFO("dns list[%s]", this->dns_address_list);
+ }
+
isCmOpened = true;
goto __SIGNAL_RETURN; /* open success */
MSG_ERR("Failed connection_profile_get_cellular_home_url");
}
+ this->dns_address_list = (char *)calloc(1, 51);
+ for (int i = 1; i <= 2; i++) {
+ char *dns = NULL;
+ err = connection_profile_get_dns_address(profile, i, CONNECTION_ADDRESS_FAMILY_IPV4, &dns);
+ if (err != CONNECTION_ERROR_NONE) {
+ MSG_ERR("Failed connection_profile_get_cellular_home_url");
+ }
+
+ if (dns != NULL) {
+ MSG_INFO("dns [%s]", dns);
+ if (g_strcmp0(dns, "0.0.0.0")) {
+ if (!(strlen(this->dns_address_list) > 1)) {
+ snprintf(this->dns_address_list, 50, "%s", dns);
+ } else {
+ snprintf(this->dns_address_list + strlen(this->dns_address_list ), 50 - strlen(this->dns_address_list ), ",%s", dns);
+ }
+ }
+ MSG_FREE(dns);
+ }
+ MSG_INFO("dns list[%s]", this->dns_address_list);
+ }
+
isCmOpened = true;
goto __SIGNAL_RETURN;
}
/* curl_easy_setopt(session_option, CURLOPT_TCP_NODELAY, 1); */
}
+ if (request_info.dns_list != NULL && strlen(request_info.dns_list) > 1) {
+ curl_easy_setopt(session_option, CURLOPT_DNS_SERVERS, request_info.dns_list);
+ }
+
MSG_END();
return http_error;
if (data == NULL) {
MSG_DEBUG("Error. data is NULL.");
+ SmsPluginSetting::instance()->setResultFromEvent(false);
return;
}
if (data == NULL) {
MSG_ERR("Error. data is NULL. result:%d", result);
+ SmsPluginSetting::instance()->setResultFromSim(false);
return;
}
int remoteFd = eventListener->getRemoteFd(); /* fd that is reserved to the "listener thread" by msgfw daemon */
- if (remoteFd == -1 )
+ if (remoteFd == -1 ) {
+ eventListener->stop();
return MSG_ERR_INVALID_MSGHANDLE;
+ }
- if (eventListener->regStorageChangeEventCB(this, remoteFd, onStorageChange, pUserParam) == false)
+ if (eventListener->regStorageChangeEventCB(this, remoteFd, onStorageChange, pUserParam) == false) {
+ eventListener->stop();
return MSG_ERR_INVALID_PARAMETER;
+ }
/* Allocate Memory to Command Data */
int cmdSize = sizeof(MSG_CMD_S) + sizeof(int); /* cmd type, listenerFd */
if (strcmp(media->szContentLocation, szTempContentID) == 0) {
return true;
}
+
+ if (media->szContentID[0] != '\0') {
+ char *pszExt = strrchr(media->szContentID, '.');
+ if (pszExt) {
+ char tmpContentID[MSG_MSG_ID_LEN+1] = {0};
+ strncpy(tmpContentID, media->szContentID, strlen(media->szContentID));
+ int extLength = strlen(pszExt);
+ int contentIDLength = strlen(media->szContentID);
+ tmpContentID[contentIDLength-extLength] = '\0';
+
+ if (g_strcmp0(tmpContentID, szTempContentID) == 0)
+ return true;
+ }
+ }
}
if (strlen(pMultipart->szContentLocation) > 0) {