diff --git a/src/commotion.c b/src/commotion.c index 7ff33ab..4400758 100644 --- a/src/commotion.c +++ b/src/commotion.c @@ -40,8 +40,8 @@ #include "msg.h" #include "commotion.h" -#define REQUEST_MAX 4096 -#define RESPONSE_MAX 4096 +#define REQUEST_MAX 65536 +#define RESPONSE_MAX 65536 static co_obj_t *_pool = NULL; static co_obj_t *_sockets = NULL; diff --git a/src/daemon.c b/src/daemon.c index b76d416..84b2db0 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -55,8 +55,8 @@ #include "list.h" #include "tree.h" -#define REQUEST_MAX 1024 -#define RESPONSE_MAX 1024 +#define REQUEST_MAX 4096 +#define RESPONSE_MAX 4096 extern co_socket_t unix_socket_proto; static int pid_filehandle; @@ -1013,6 +1013,13 @@ int main(int argc, char *argv[]) { CMD_REGISTER(new, "new ", "Create a new profile."); CMD_REGISTER(delete, "delete ", "Delete a profile."); + struct sigaction sa = {{0}}; + sa.sa_handler = SIG_IGN; // handle socket errors gracefully + if (sigaction(SIGPIPE, &sa, 0) == -1) { + perror("Error setting signal handler"); + exit(1); + } + /* Set up sockets */ co_socket_t *socket = (co_socket_t*)NEW(co_socket, unix_socket); socket->poll_cb = dispatcher_cb;