Skip to Content.
Sympa Menu

ndt-dev - [ndt] r320 committed - Updating branch with trunk changes....

Subject: NDT-DEV email list created

List archive

[ndt] r320 committed - Updating branch with trunk changes....


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt] r320 committed - Updating branch with trunk changes....
  • Date: Tue, 23 Mar 2010 15:10:26 +0000

Revision: 320
Author: jwzurawski
Date: Tue Mar 23 08:09:43 2010
Log: Updating branch with trunk changes.

-jason


http://code.google.com/p/ndt/source/detail?r=320

Modified:
/branches/jz-localization
/branches/jz-localization/Applet/Tcpbw100.java
/branches/jz-localization/Applet/Tcpbw100_msgs_en_US.properties
/branches/jz-localization/Applet/Tcpbw100_msgs_nb_NO.properties
/branches/jz-localization/src/fakewww.c
/branches/jz-localization/src/test_sfw_srv.c
/branches/jz-localization/src/testoptions.c
/branches/jz-localization/src/web100-util.c
/branches/jz-localization/src/web100srv.c
/branches/jz-localization/src/web100srv.h

=======================================
--- /branches/jz-localization/Applet/Tcpbw100.java Wed Mar 17 06:44:30
2010
+++ /branches/jz-localization/Applet/Tcpbw100.java Tue Mar 23 08:09:43
2010
@@ -857,16 +857,13 @@
emailText = messages.getString("checkingMiddleboxes") + " ";

if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected prepare, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
return true;
}
if (msg.type != TEST_PREPARE) {
errmsg = messages.getString("mboxWrongMessage") + "\n";
if (msg.type == MSG_ERROR) {
- errmsg += "ERROR MSG: " + new String(msg.body) + "\n";
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
}
return true;
}
@@ -910,16 +907,13 @@
s2cspd = ((8.0 * bytes) / 1000) / t;

if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected test data, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
return true;
}
if (msg.type != TEST_MSG) {
errmsg = messages.getString("mboxWrongMessage") + "\n";
if (msg.type == MSG_ERROR) {
- errmsg += "ERROR MSG: " + new String(msg.body) + "\n";
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
}
return true;
}
@@ -952,16 +946,13 @@
in2Socket.close();

if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected finalize, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
return true;
}
if (msg.type != TEST_FINALIZE) {
errmsg = messages.getString("mboxWrongMessage");
if (msg.type == MSG_ERROR) {
- errmsg += "ERROR MSG: " + new String(msg.body) + "\n";
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
}
return true;
}
@@ -982,16 +973,13 @@
emailText = messages.getString("checkingFirewalls") + " ";

if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected prepare, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
return true;
}
if (msg.type != TEST_PREPARE) {
errmsg = messages.getString("sfwWrongMessage") + "\n";
if (msg.type == MSG_ERROR) {
- errmsg += "ERROR MSG: " + new String(msg.body) + "\n";
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
}
return true;
}
@@ -1031,16 +1019,13 @@
ctl.send_msg(TEST_MSG, Integer.toString(srvSocket.getLocalPort()).getBytes());

if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected port number, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
return true;
}
if (msg.type != TEST_START) {
errmsg = messages.getString("sfwWrongMessage");
if (msg.type == MSG_ERROR) {
- errmsg += "ERROR MSG: " + new String(msg.body) + "\n";
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
}
return true;
}
@@ -1060,16 +1045,13 @@
}

if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected test data, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
return true;
}
if (msg.type != TEST_MSG) {
errmsg = messages.getString("sfwWrongMessage") + "\n";
if (msg.type == MSG_ERROR) {
- errmsg += "ERROR MSG: " + new String(msg.body) + "\n";
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
}
return true;
}
@@ -1078,16 +1060,13 @@
osfwTest.finalize();

if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected finalize, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
return true;
}
if (msg.type != TEST_FINALIZE) {
errmsg = messages.getString("sfwWrongMessage") + "\n";
if (msg.type == MSG_ERROR) {
- errmsg += "ERROR MSG: " + new String(msg.body) + "\n";
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
}
return true;
}
@@ -1110,16 +1089,13 @@
emailText += messages.getString("runningOutboundTest") + " ";

if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected prepare, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
return true;
}
if (msg.type != TEST_PREPARE) {
errmsg = messages.getString("outboundWrongMessage") + "\n";
if (msg.type == MSG_ERROR) {
- errmsg += "ERROR MSG: " + new String(msg.body) + "\n";
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
}
return true;
}
@@ -1148,16 +1124,13 @@
// wait here for signal from server application
// This signal tells the client to start pumping out data
if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected start signal, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
return true;
}
if (msg.type != TEST_START) {
errmsg = messages.getString("outboundWrongMessage") + "\n";
if (msg.type == MSG_ERROR) {
- errmsg += "ERROR MSG: " + new String(msg.body) + "\n";
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
}
return true;
}
@@ -1197,16 +1170,13 @@
c2sspd = ((8.0 * pkts * lth) / 1000) / t;
/* receive the c2sspd from the server */
if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected test data, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
return true;
}
if (msg.type != TEST_MSG) {
errmsg = messages.getString("outboundWrongMessage");
if (msg.type == MSG_ERROR) {
- errmsg += "ERROR MSG: " + new String(msg.body) + "\n";
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
}
return true;
}
@@ -1228,16 +1198,13 @@
pub_c2sspd = sc2sspd;

if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected finalize, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
return true;
}
if (msg.type != TEST_FINALIZE) {
errmsg = messages.getString("outboundWrongMessage");
if (msg.type == MSG_ERROR) {
- errmsg += "ERROR MSG: " + new String(msg.body) + "\n";
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
}
return true;
}
@@ -1256,16 +1223,13 @@
emailText += messages.getString("runningInboundTest") + " ";

if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected prepare, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
return true;
}
if (msg.type != TEST_PREPARE) {
errmsg = messages.getString("inboundWrongMessage") + "\n";
if (msg.type == MSG_ERROR) {
- errmsg += "ERROR MSG: " + new String(msg.body) + "\n";
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
}
return true;
}
@@ -1292,16 +1256,13 @@

// wait here for signal from server application
if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected start signal, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("unknownServer") + "\n";
+ errmsg = messages.getString("unknownServer") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
return true;
}
if (msg.type != TEST_START) {
errmsg = messages.getString("serverFail") + "\n";
if (msg.type == MSG_ERROR) {
- errmsg += "ERROR MSG: " + new String(msg.body) + "\n";
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
}
return true;
}
@@ -1324,16 +1285,13 @@

/* receive the s2cspd from the server */
if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected test data, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
return true;
}
if (msg.type != TEST_MSG) {
errmsg = messages.getString("inboundWrongMessage") + "\n";
if (msg.type == MSG_ERROR) {
- errmsg += "ERROR MSG: " + new String(msg.body) + "\n";
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
}
return true;
}
@@ -1382,10 +1340,7 @@
try {
for (;;) {
if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected finalize, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
return true;
}
if (msg.type == TEST_FINALIZE) {
@@ -1394,7 +1349,7 @@
if (msg.type != TEST_MSG) {
errmsg = messages.getString("inboundWrongMessage") + "\n";
if (msg.type == MSG_ERROR) {
- errmsg += "ERROR MSG: " + new String(msg.body) + "\n";
+ errmsg += "ERROR MSG: " + Integer.parseInt(new String(msg.body), 16) + "\n";
}
return true;
}
@@ -1488,10 +1443,7 @@

for (;;) {
if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected wait time, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
failed = true;
return;
}
@@ -1535,10 +1487,7 @@
ff.toBack();

if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected hello signal, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
failed = true;
return;
}
@@ -1557,10 +1506,7 @@
System.out.println("Server version: " + vVersion.substring(1));

if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected server version info, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
failed = true;
return;
}
@@ -1635,10 +1581,7 @@
try {
for (;;) {
if (ctl.recv_msg(msg) != 0) {
- //errmsg = "Protocol error! Expected test results, got: " + new String(msg.body) + "instead\n";
- // XXX JZ: 03/08/2010
- // Reverting to old error message.
- errmsg = messages.getString("protocolError") + "\n";
+ errmsg = messages.getString("protocolError") + Integer.parseInt(new String(msg.body), 16) + " instead\n";
failed = true;
return;
}
=======================================
--- /branches/jz-localization/Applet/Tcpbw100_msgs_en_US.properties Wed Mar 17 06:44:30 2010
+++ /branches/jz-localization/Applet/Tcpbw100_msgs_en_US.properties Tue Mar 23 08:09:43 2010
@@ -136,7 +136,7 @@
possibleDuplexHalfFullWarning = Warning: Possible Duplex Mismatch condition detected Switch=half and Host=full
preferIPv6 = prefer IPv6
printDetailedStats = Print Detailed Statistics
-protocolError = Protocol error!
+protocolError = Protocol error! Expected 'prepare', got: 0x
qSeen = throughput test: Packet queuing detected
ready = Tcpbw100 ready
receiveBufferShouldBe = Information: The receive buffer should be
=======================================
--- /branches/jz-localization/Applet/Tcpbw100_msgs_nb_NO.properties Wed Mar 17 06:44:30 2010
+++ /branches/jz-localization/Applet/Tcpbw100_msgs_nb_NO.properties Tue Mar 23 08:09:43 2010
@@ -135,7 +135,7 @@
possibleDuplexHalfFullWarning = Advarsel: Mulig dupleksitetsfeil oppdaget; svitsj=halv og maskin=full
preferIPv6 = bruk IPv6 hvis mulig
printDetailedStats = Viser detaljer
-protocolError = Protokollfeil!
+protocolError = Protokollfeil! Mottok: 0x
qSeen = ytelsestest: Pakkek\u00f8ing oppdaget
ready = Tcpbw100 klar
receiveBufferShouldBe = Informasjon: Mottaksbufferen burde v\u00e6re
=======================================
--- /branches/jz-localization/src/fakewww.c Mon Apr 6 12:39:53 2009
+++ /branches/jz-localization/src/fakewww.c Tue Mar 23 08:09:43 2010
@@ -70,7 +70,7 @@
"/"ADMINFILE, "/Admin.class", "/tr.sh", "/traceroute.pl",
"/Tcpbw100$MyTextPane.class",
"/Tcpbw100$Protocol.class", "/Tcpbw100$StatusPanel.class",
"/Tcpbw100$3.class",
"/Tcpbw100$OsfwWorker.class", "/Tcpbw100$Message.class",
"/Tcpbw100$StatusPanel$1.class",
- "/Tcpbw100$clsFrame$1.class", "/Tcpbw100$TestWorker.class", 0};
+ "/Tcpbw100$clsFrame$1.class", "/Tcpbw100$TestWorker.class", "/crossdomain.xml", 0};

typedef struct allowed {
char* filename;
=======================================
--- /branches/jz-localization/src/test_sfw_srv.c Tue Oct 13 07:49:45
2009
+++ /branches/jz-localization/src/test_sfw_srv.c Tue Mar 23 08:09:43
2010
@@ -19,7 +19,7 @@
static pthread_mutex_t mainmutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t maincond = PTHREAD_COND_INITIALIZER;
static I2Addr sfwcli_addr = NULL;
-static int testTime = 30;
+static int testTime = 3;
static int toWait = 1;
static pthread_t threadId = -1;

@@ -33,7 +33,7 @@
catch_alrm(int signo)
{
if (signo == SIGALRM) {
- log_println(1, "SIGALRM was caught");
+ log_println(1, "SFW - SIGALRM was caught");
if (threadId != -1) { /* we forward the signal to the osfw thread */
pthread_kill(threadId, SIGALRM);
threadId =-1;
@@ -59,7 +59,7 @@
memset(&new, 0, sizeof(new));
new.sa_handler = catch_alrm;
sigaction(SIGALRM, &new, &old);
- alarm(testTime + 1);
+ alarm(testTime);
if (CreateConnectSocket(&sfwsock, NULL, sfwcli_addr, 0, 0) == 0) {
send_msg(sfwsock, TEST_MSG, "Simple firewall test", 20);
}
@@ -127,7 +127,7 @@

if (options->sfwopt) {
setCurrentTest(TEST_SFW);
- log_println(1, " <-- Simple firewall test -->");
+ log_println(1, " <-- %d - Simple firewall test -->", options->child0);

sfwsrv_addr = CreateListenSocket(NULL, "0", conn_options, 0);
if (sfwsrv_addr == NULL) {
@@ -154,8 +154,8 @@
maxRTO = atoi(web100_value_to_text(web100_get_var_type(var), buff));
if (maxRTT > maxRTO)
maxRTO = maxRTT;
- if (((((double) maxRTO) / 1000.0) + 1) < 30.0)
- testTime = ((double) maxRTO) / 1000.0 + 1;
+ if ((((double) maxRTO) / 1000.0) < 3.0)
+ testTime = (((double) maxRTO) / 1000.0) * 4 ;
}
else {
log_println(0, "Simple firewall test: Cannot find connection");
@@ -164,7 +164,7 @@
I2AddrFree(sfwsrv_addr);
return -1;
}
- log_println(1, " -- time: %d", testTime);
+ log_println(1, " -- SFW time: %d", testTime);

sprintf(buff, "%d %d", sfwsockport, testTime);
send_msg(ctlsockfd, TEST_PREPARE, buff, strlen(buff));
@@ -214,7 +214,7 @@

FD_ZERO(&fds);
FD_SET(sfwsockfd, &fds);
- sel_tv.tv_sec = testTime + 1;
+ sel_tv.tv_sec = testTime;
sel_tv.tv_usec = 0;
switch (select(sfwsockfd+1, &fds, NULL, NULL, &sel_tv)) {
case -1:
=======================================
--- /branches/jz-localization/src/testoptions.c Sun Feb 28 11:29:32 2010
+++ /branches/jz-localization/src/testoptions.c Tue Mar 23 08:09:43 2010
@@ -282,7 +282,7 @@

if (options->midopt) {
setCurrentTest(TEST_MID);
- log_println(1, " <-- Middlebox test -->");
+ log_println(1, " <-- %d - Middlebox test -->", options->child0);
strcpy(listenmidport, PORT3);

if (options->midsockport) {
@@ -469,7 +469,7 @@

if (testOptions->c2sopt) {
setCurrentTest(TEST_C2S);
- log_println(1, " <-- C2S throughput test -->");
+ log_println(1, " <-- %d - C2S throughput test -->", testOptions->child0);
strcpy(listenc2sport, PORT2);

if (testOptions->c2ssockport) {
@@ -865,7 +865,7 @@

if (testOptions->s2copt) {
setCurrentTest(TEST_S2C);
- log_println(1, " <-- S2C throughput test -->");
+ log_println(1, " <-- %d - S2C throughput test -->", testOptions->child0);
strcpy(listens2cport, PORT4);

if (testOptions->s2csockport) {
@@ -1111,7 +1111,7 @@
pthread_mutex_unlock(&mainmutex);
}

- alarm(20);
+ /* alarm(20); */
t = secs();
s = t + 10.0;

=======================================
--- /branches/jz-localization/src/web100-util.c Sun Feb 28 12:04:47 2010
+++ /branches/jz-localization/src/web100-util.c Tue Mar 23 08:09:43 2010
@@ -258,7 +258,7 @@
sprintf(web_vars[i].value, "%s", web100_value_to_text(web100_get_var_type(var), buf));
sprintf(line, "%s: %d\n", web_vars[i].name, atoi(web_vars[i].value));
send_msg(ctlsock, TEST_MSG, line, strlen(line));
- log_print(6, "%s", line);
+ log_print(9, "%s", line);
}
log_println(6, "S2C test - Send web100 data to client pid=%d", getpid());
return(0);
=======================================
--- /branches/jz-localization/src/web100srv.c Sun Feb 28 11:51:47 2010
+++ /branches/jz-localization/src/web100srv.c Tue Mar 23 08:09:43 2010
@@ -259,11 +259,11 @@
log_println(3, "wstopsig = %d", WSTOPSIG(status));
}
if (status != 0) {
- log_println(4, "child_sig() routine, wait4() non-zero status (%d) returned", status);
+ log_println(4, "child_sig() routine, wait3() non-zero status (%d) returned", status);
return;
}
}
- log_println(6, "child_sig() called pid=%d, wait3 returned child=%d - status=%d",
+ log_println(6, "child_sig() called pid=%d, wait returned child=%d - status=%d",
chld_pid, pid, status);
if (pid == 0) {
log_println(6, "wait3() failed to return non-zero PID, ignore it");
@@ -480,6 +480,7 @@
getpid());
fclose(fp);
}
+ sig13 = 1;
break;

case SIGHUP:
@@ -1275,7 +1276,8 @@
int
main(int argc, char** argv)
{
- int chld_pid, rc;
+ pid_t chld_pid;
+ int rc;
int tpid, mwaiting = 0;
int ctlsockfd = -1;
int c, chld_pipe[2];
@@ -1672,6 +1674,7 @@
waiting = 0;
loopcnt = 0;
head_ptr = NULL;
+ sig13 = 0;
sig17 = 0;
sig1 = 0;
sig2 = 0;
@@ -1686,8 +1689,14 @@
head_ptr->pid, testing, waiting, mclients, zombie_check);

/* moved condition from interrupt handler to here */
- if ((sig1 > 0) || (sig2 > 0))
- check_signal_flags;
+ /* if ((sig1 > 0) || (sig2 > 0))
+ * check_signal_flags;
+ */
+
+ if (sig13 == 1) {
+ log_println(5, "todo: Handle SIGPIPE signal, terminate child?");
+ sig13 = 0;
+ }

if (sig17 > 0) {
log_println(5, "Handle pending SIGCHLD signal, count=%d", sig17);
@@ -1695,7 +1704,7 @@
}

if ((waiting < 0) || (mclients < 0)) {
- log_println(6, "Fault: Negtive numver of clents waiting=$d, mclients=%d, nuke them", waiting, mclients);
+ log_println(6, "Fault: Negtive number of clents waiting=$d, mclients=%d, nuke them", waiting, mclients);
while (head_ptr != NULL) {
tpid = head_ptr->pid;
child_sig(-1);
@@ -1869,7 +1878,14 @@
}

/* the specially crafted data that kicks off the old clients */
- write(ctlsockfd, "123456 654321", 13);
+ for (i=0; i<5; i++) {
+ rc = write(ctlsockfd, "123456 654321", 13);
+ if ((rc == -1) && (errno == EINTR))
+ continue;
+ if (rc == 13)
+ break;
+ /* todo: handle other error contitions */
+ }
new_child = (struct ndtchild *) malloc(sizeof(struct ndtchild));
memset(new_child, 0, sizeof(struct ndtchild));
tt = time(0);
@@ -1893,6 +1909,7 @@
switch (chld_pid) {
case -1: /* an error occured, log it and quit */
log_println(0, "fork() failed, errno = %d", errno);
+ /* todo: handle error and continue */
break;
default: /* this is the parent process, handle scheduling and
* queuing of multiple incoming clients
@@ -2112,7 +2129,14 @@
mclients++;
sprintf(tmpstr, "go %d %s", t_opts, test_suite);
send_msg(mchild->ctlsockfd, SRV_QUEUE, "0", 1);
- write(mchild->pipe, tmpstr, strlen(tmpstr));
+ for (i=0; i<5; i++) {
+ rc = write(mchild->pipe, tmpstr, strlen(tmpstr));
+ if ((rc == -1) && (errno == EINTR))
+ continue;
+ if (rc == strlen(tmpstr))
+ break;
+ /* TODO: handle other error conditions */
+ }
close(mchild->pipe);
close(mchild->ctlsockfd);
}
@@ -2121,7 +2145,14 @@
head_ptr->running = 1;
sprintf(tmpstr, "go %d %s", t_opts, head_ptr->tests);
send_msg(head_ptr->ctlsockfd, SRV_QUEUE, "0", 1);
- write(head_ptr->pipe, tmpstr, strlen(tmpstr));
+ for (i=0; i<5; i++) {
+ rc = write(head_ptr->pipe, tmpstr, strlen(tmpstr));
+ if ((rc == -1) && (errno == EINTR))
+ continue;
+ if (rc == strlen(tmpstr))
+ break;
+ /* TODO: handle other error conditions */
+ }
close(head_ptr->pipe);
close(head_ptr->ctlsockfd);
}
@@ -2147,6 +2178,10 @@
*/
for (;;) {
memset(buff, 0, sizeof(buff));
+/* the read() could return if an interrupt was caught. This condition
+ * should be checked for and the read() restarted if necessary
+ * RAC 3/18/10
+ */
read(chld_pipe[0], buff, 32);
if (strncmp(buff, "go", 2) == 0) {
log_println(6, "Got 'go' signal from parent, ready to start testing");
=======================================
--- /branches/jz-localization/src/web100srv.h Sun Feb 28 11:29:32 2010
+++ /branches/jz-localization/src/web100srv.h Tue Mar 23 08:09:43 2010
@@ -220,6 +220,7 @@
/* global variables for signal processing */
sig_atomic_t sig1;
sig_atomic_t sig2;
+sig_atomic_t sig13;
sig_atomic_t sig17;
pid_t sig17_pid[256];



  • [ndt] r320 committed - Updating branch with trunk changes...., ndt, 03/23/2010

Archive powered by MHonArc 2.6.16.

Top of Page