value = NULL;
DA_LOGV("[Date][%s]", date_from_response);
}
- DA_SECURE_LOGD("downloaded_size[%u]", file_info->bytes_written_to_file);
+ DA_SECURE_LOGD("downloaded_size[%llu]", file_info->bytes_written_to_file);
snprintf(temp_size_str, sizeof(temp_size_str), "bytes=%llu-",
file_info->bytes_written_to_file);
DA_SECURE_LOGD("size str[%s]", temp_size_str);
case HTTP_STATE_DOWNLOAD_STARTED:
case HTTP_STATE_DOWNLOADING:
case HTTP_STATE_REQUEST_PAUSE:
- DA_LOGE("Cannot enter here:[%s][id]",
+ DA_LOGE("Cannot enter here:[%s][%d]",
__get_state_str(http_info->state), da_info->da_id);
break;
case HTTP_STATE_REQUEST_CANCEL:
DA_MUTEX_UNLOCK(&(http_info->mutex_state));
if (da_info->thread_id > 0) {
if (pthread_cancel(da_info->thread_id) != 0) {
- DA_LOGE("Fail to cancel thread id[%d]",
+ DA_LOGE("Fail to cancel thread id[%lu]",
da_info->thread_id);
pthread_join(da_info->thread_id, (void **)&status);
} else {
unsigned can_unload = 0;
if (tailp->id <= 0 || tailp->state == DP_STATE_NONE) {
- TRACE_ERROR("id:%d unexpected request (%ld/%ld)", tailp->id, tailp->access_time, now_time);
+ TRACE_ERROR("id:%d unexpected request (%d/%d)", tailp->id, tailp->access_time, now_time);
can_unload = 1;
} else if (tailp->access_time > 0 &&
(now_time - tailp->access_time) > DP_CARE_CLIENT_CLEAR_INTERVAL) {
tailp->state == DP_STATE_FAILED) {
can_unload = 1;
} else if (tailp->state == DP_STATE_CONNECTING) { // it take 120 sec over to connect. it means zombie.
- TRACE_ERROR("id:%d connection timeout (%ld/%ld)", tailp->id, tailp->access_time, now_time);
+ TRACE_ERROR("id:%d connection timeout (%d/%d)", tailp->id, tailp->access_time, now_time);
if (dp_cancel_agent_download_without_update(tailp->agent_id) < 0) {
TRACE_ERROR("failed to cancel download(%d) id:%d", tailp->agent_id, tailp->id);
}
} else if (tailp->state == DP_STATE_PAUSED &&
dp_is_alive_download(tailp->agent_id) == 0) {
// paused & agent_id not exist.... unload from memory.
- TRACE_ERROR("id:%d hanged as paused (%ld/%ld)", tailp->id, tailp->access_time, now_time);
+ TRACE_ERROR("id:%d hanged as paused (%d/%d)", tailp->id, tailp->access_time, now_time);
can_unload = 1;
}
char *string = NULL;
unsigned length = 0;
if (dp_db_get_property_string(client->dbhandle, ipc_info->id, DP_TABLE_REQUEST, DP_DB_COL_URL, (unsigned char **)&string, &length, &errorcode) < 0) {
- TRACE_ERROR("failed to get %d", dp_print_property(ipc_info->property));
+ TRACE_ERROR("failed to get %s", dp_print_property(ipc_info->property));
errorcode = DP_ERROR_NO_DATA;
}
int result = __dp_request_feedback_string(client->channel, ipc_info, string, length, errorcode);
char *string = NULL;
unsigned length = 0;
if (dp_db_get_property_string(client->dbhandle, ipc_info->id, DP_TABLE_REQUEST, DP_DB_COL_DESTINATION, (unsigned char **)&string, &length, &errorcode) < 0) {
- TRACE_ERROR("failed to get %d", dp_print_property(ipc_info->property));
+ TRACE_ERROR("failed to get %s", dp_print_property(ipc_info->property));
errorcode = DP_ERROR_NO_DATA;
}
int result = __dp_request_feedback_string(client->channel, ipc_info, string, length, errorcode);
char *string = NULL;
unsigned length = 0;
if (dp_db_get_property_string(client->dbhandle, ipc_info->id, DP_TABLE_REQUEST, DP_DB_COL_FILENAME, (unsigned char **)&string, &length, &errorcode) < 0) {
- TRACE_ERROR("failed to get %d", dp_print_property(ipc_info->property));
+ TRACE_ERROR("failed to get %s", dp_print_property(ipc_info->property));
errorcode = DP_ERROR_NO_DATA;
}
int result = __dp_request_feedback_string(client->channel, ipc_info, string, length, errorcode);
// 3. send response & field string for each fields
int field_count = dp_db_check_duplicated_int(client->dbhandle, DP_TABLE_HEADERS, DP_DB_COL_ID, ipc_info->id, &errorcode);
if (field_count < 0 ) {
- TRACE_ERROR("failed to get %d", dp_print_property(ipc_info->property));
+ TRACE_ERROR("failed to get %s", dp_print_property(ipc_info->property));
errorcode = DP_ERROR_DISK_BUSY;
field_count = 0;
}
char *string = NULL;
unsigned length = 0;
if (dp_db_get_cond_string(client->dbhandle, DP_TABLE_HEADERS, DP_DB_COL_ROW_ID, ids[i], DP_DB_COL_HEADER_FIELD, (unsigned char **)&string, &length, &errorcode) < 0) {
- TRACE_ERROR("failed to get %d", dp_print_property(ipc_info->property));
+ TRACE_ERROR("failed to get %s", dp_print_property(ipc_info->property));
errorcode = DP_ERROR_NO_DATA;
}
int result = __dp_request_feedback_string(client->channel, ipc_info, string, length, errorcode);
void dp_client_sig_handler(int signo)
{
- TRACE_INFO("thread:%0x signal:%d", pthread_self(), signo);
+ TRACE_INFO("thread:%lu signal:%d", pthread_self(), signo);
}
void *dp_client_request_thread(void *arg)
// wait detaching thread
CLIENT_MUTEX_LOCK(&slot->mutex);
- TRACE_INFO("slot %p thread:%0x", slot, slot->thread);
+ TRACE_INFO("slot %p thread:%lu", slot, slot->thread);
struct sigaction act = {{0},};
sigset_t newmask;
// if no requests, clear slot after disconnect with client.
CLIENT_MUTEX_LOCK(&slot->mutex);
- TRACE_INFO("thread done slot %p thread:%0x", slot, slot->thread);
+ TRACE_INFO("thread done slot %p thread:%lu", slot, slot->thread);
slot->thread = 0;// to prevent kill thread twice
close(slot->client.channel);
slot->client.channel = -1;
}
- TRACE_INFO("thread done slot %p thread:%0x sock:%d", slot, slot->thread, client_sock);
+ TRACE_INFO("thread done slot %p thread:%lu sock:%d", slot, slot->thread, client_sock);
CLIENT_MUTEX_UNLOCK(&slot->mutex);
return 0;
}