/* resume case */
if (req_info->etag || req_info->temp_file_path) {
- char *file_path = DA_NULL;
- char *origin_path = DA_NULL;
- file_path = req_info->temp_file_path;
- if (!file_path)
- return DA_ERR_INVALID_ARGUMENT;
- origin_path = file_info->file_path;
- file_info->file_path = strdup(file_path);
- free(origin_path);
- ret = __decide_file_path_for_resume(file_info);
- if(file_info) {
- ret = __decide_file_path_for_resume(file_info);
- }
+ char *file_path = DA_NULL;
+ char *origin_path = DA_NULL;
+ file_path = req_info->temp_file_path;
+ if (!file_path)
+ return DA_ERR_INVALID_ARGUMENT;
+ origin_path = file_info->file_path;
+ file_info->file_path = strdup(file_path);
+ free(origin_path);
+ if(file_info) {
+ ret = __decide_file_path_for_resume(file_info);
+ }
} else {
ret = __decide_file_path(da_info);
}
struct timeval tv_timeo = {1, 500000}; // 1.5 sec
if (setsockopt(clientfd, SOL_SOCKET, SO_RCVTIMEO, &tv_timeo,
sizeof(tv_timeo)) < 0) {
- TRACE_ERROR("failed to set timeout in blocking socket");
+ TRACE_ERROR("failed to set timeout in blocking socket");
+ errorcode = DP_ERROR_IO_ERROR;
}
dp_ipc_fmt ipc_info;
}
#endif
+ if (errorcode == DP_ERROR_NONE) {
errorcode = __dp_db_open_client_manager();
+ }
- if (errorcode == DP_ERROR_NONE) {
+ if (errorcode == DP_ERROR_NONE) {
if (ipc_info.section == DP_SEC_INIT) {
// new client
errorcode = DP_ERROR_INVALID_PARAMETER;
}
}
- if (dp_ipc_query(clientfd, -1, ipc_info.section, DP_PROP_NONE, errorcode, 0) < 0) {
+ if (dp_ipc_query(clientfd, -1, ipc_info.section, DP_PROP_NONE, errorcode, 0) < 0) {
TRACE_ERROR("check ipc sock:%d", clientfd);
}
- if (errorcode != DP_ERROR_NONE) {
+ if (errorcode != DP_ERROR_NONE) {
TRACE_ERROR("sock:%d id:%d section:%s property:%s errorcode:%s size:%d",
clientfd, ipc_info.id,
dp_print_section(ipc_info.section),
ipc_info.size);
close(clientfd); // ban this client
}
- if (errorcode == DP_ERROR_NO_SPACE || errorcode == DP_ERROR_DISK_BUSY) {
+ if (errorcode == DP_ERROR_NO_SPACE || errorcode == DP_ERROR_DISK_BUSY) {
TRACE_ERROR("provider can't work anymore errorcode:%s", dp_print_errorcode(errorcode));
//break; // provider will be terminated after sending errorcode by each thread
}