#endif
#if !defined(FLOG)
-#define DbgPrint(format, arg...) SECURE_LOGD("[\e[32m%s/%s\e[0m:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg)
-#define ErrPrint(format, arg...) SECURE_LOGE("[\e[32m%s/%s\e[0m:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg)
+#define DbgPrint(format, arg...) SECURE_LOGD(format, ##arg)
+#define ErrPrint(format, arg...) SECURE_LOGE(format, ##arg)
#else
extern FILE *__file_log_fp;
#define DbgPrint(format, arg...) do { fprintf(__file_log_fp, "[LOG] [\e[32m%s/%s\e[0m:%d] " format, util_basename(__FILE__), __func__, __LINE__, ##arg); fflush(__file_log_fp); } while (0)
Name: libcom-core
Summary: Library for the light-weight IPC
-Version: 0.4.1
+Version: 0.4.2
Release: 1
Group: HomeTF/Framework
License: Apache License
}
if ((cond & G_IO_ERR) || (cond & G_IO_HUP) || (cond & G_IO_NVAL)) {
- DbgPrint("Client connection is lost\n");
+ ErrPrint("Client connection is lost\n");
secure_socket_destroy_handle(socket_fd);
free(cbdata);
return FALSE;
}
- DbgPrint("New connectino arrived: socket(%d)\n", socket_fd);
client_fd = secure_socket_get_connection_handle(socket_fd);
if (client_fd < 0) {
free(cbdata);
return FALSE;
}
- DbgPrint("New client: %d\n", client_fd);
+ DbgPrint("New connectino arrived: server(%d), client(%d)\n", socket_fd, client_fd);
if (fcntl(client_fd, F_SETFD, FD_CLOEXEC) < 0)
ErrPrint("Error: %s\n", strerror(errno));
g_io_channel_unref(gio);
invoke_con_cb_list(client_fd);
- DbgPrint("New client is connected with %d\n", client_fd);
return TRUE;
}
if (!is_sync && fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
ErrPrint("fcntl: %s\n", strerror(errno));
- DbgPrint("Create new IO channel for socket FD: %d\n", fd);
+ DbgPrint("Create new IO channel for server FD: %d\n", fd);
gio = g_io_channel_unix_new(fd);
if (!gio) {
ErrPrint("Failed to create new io channel\n");
if (fd < 0)
return NULL;
- DbgPrint("FD: %d\n", fd);
-
if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0)
ErrPrint("fcntl: %s\n", strerror(errno));
if (ret < 0)
goto out;
- DbgPrint("Sent: %d bytes (%d bytes)\n", ret, packet_size(packet));
-
ptr = malloc(packet_header_size());
if (!ptr) {
ErrPrint("Heap: %s\n", strerror(errno));
}
size = packet_payload_size(result);
- DbgPrint("Payload size: %d\n", size);
if (size < 0) {
packet_destroy(result);
result = NULL;
}
if (!(cond & G_IO_IN)) {
- DbgPrint("PIPE is not valid\n");
+ ErrPrint("PIPE is not valid\n");
goto errout;
}
if ((cond & G_IO_ERR) || (cond & G_IO_HUP) || (cond & G_IO_NVAL)) {
- DbgPrint("PIPE is not valid\n");
+ ErrPrint("PIPE is not valid\n");
goto errout;
}
return NULL;
}
- DbgPrint("[%d] New TCB created: %d, %d\n", client_fd, tcb->evt_pipe[PIPE_READ], tcb->evt_pipe[PIPE_WRITE]);
+ DbgPrint("[%d] New TCB created: R(%d), W(%d)\n", client_fd, tcb->evt_pipe[PIPE_READ], tcb->evt_pipe[PIPE_WRITE]);
return tcb;
}
return FALSE;
}
- DbgPrint("New connection is made: socket(%d)\n", socket_fd);
fd = secure_socket_get_connection_handle(socket_fd);
if (fd < 0) {
ErrPrint("Failed to get client fd from socket\n");
return FALSE;
}
- DbgPrint("New client: %d\n", fd);
if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0)
ErrPrint("Error: %s\n", strerror(errno));
}
g_io_channel_unref(gio);
- DbgPrint("New client is connected with %d\n", tcb->handle);
invoke_con_cb_list(tcb->handle);
ret = pthread_create(&tcb->thid, NULL, client_cb, tcb);
g_io_channel_unref(gio);
- DbgPrint("New client is connected with %d\n", client_fd);
invoke_con_cb_list(tcb->handle);
ret = pthread_create(&tcb->thid, NULL, client_cb, tcb);