[Cluster-devel] conga/ricci/common ClientSocket.cpp Module.cpp
rmccabe at sourceware.org
rmccabe at sourceware.org
Fri Jun 1 23:12:22 UTC 2007
CVSROOT: /cvs/cluster
Module name: conga
Branch: EXPERIMENTAL
Changes by: rmccabe at sourceware.org 2007-06-01 23:12:22
Modified files:
ricci/common : ClientSocket.cpp Module.cpp
Log message:
- Increase read buffers for network traffic from 1k to 4k, and include
errno info in exceptions in the network code.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/ClientSocket.cpp.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.7&r2=1.7.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/Module.cpp.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.5&r2=1.5.8.1
--- conga/ricci/common/ClientSocket.cpp 2007/03/23 17:25:12 1.7
+++ conga/ricci/common/ClientSocket.cpp 2007/06/01 23:12:22 1.7.2.1
@@ -27,6 +27,7 @@
#include <unistd.h>
#include <errno.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
@@ -159,14 +160,14 @@
throw String("ClientSocket::recv(): socket already closed");
while (true) {
- char buffer[1024];
+ char buffer[4096];
int ret = ::recv(_sock, buffer, sizeof(buffer), 0);
if (ret == -1) {
if (errno == EINTR)
continue;
else if (errno == EAGAIN)
return "";
- throw String("ClientSocket::recv(): recv error");
+ throw String("ClientSocket::recv(): recv error: ") + String(strerror(errno));
}
if (ret == 0) {
@@ -204,10 +205,9 @@
if (ret == -1) {
if (errno == EINTR)
continue;
- else if (errno == EAGAIN ||
- errno == EWOULDBLOCK)
+ else if (errno == EAGAIN || errno == EWOULDBLOCK)
return msg;
- throw String("ClientSocket::send(): socket error");
+ throw String("ClientSocket::send(): socket error: ") + String(strerror(errno));
}
// log(String("sent ") + ret + " bytes thru socket " + _sock,
--- conga/ricci/common/Module.cpp 2006/08/15 04:15:52 1.5
+++ conga/ricci/common/Module.cpp 2007/06/01 23:12:22 1.5.8.1
@@ -1,5 +1,5 @@
/*
- Copyright Red Hat, Inc. 2006
+ Copyright Red Hat, Inc. 2006-2007
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -276,7 +276,7 @@
// process event
if (poll_data.revents & POLLIN) {
- char buff[1024];
+ char buff[4096];
int ret = read(poll_data.fd, buff, sizeof(buff));
if (ret == -1) {
if (errno == EINTR)
More information about the Cluster-devel
mailing list