[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] conga/ricci/common Module.cpp



CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	EXPERIMENTAL
Changes by:	rmccabe sourceware org	2007-06-18 03:54:09

Modified files:
	ricci/common   : Module.cpp 

Log message:
	duh.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/Module.cpp.diff?cvsroot=cluster&only_with_tag=EXPERIMENTAL&r1=1.5.8.2&r2=1.5.8.3

--- conga/ricci/common/Module.cpp	2007/06/02 04:28:48	1.5.8.2
+++ conga/ricci/common/Module.cpp	2007/06/18 03:54:09	1.5.8.3
@@ -290,27 +290,31 @@
 		// process event
 		if (poll_data.revents & POLLIN) {
 			char buff[4096];
-			int ret = read(poll_data.fd, buff, sizeof(buff));
+			int ret;
+
+			ret = read(poll_data.fd, buff, sizeof(buff));
 			if (ret == -1) {
 				if (errno == EINTR)
 					continue;
 				throw String("error reading stdin: ") + String(strerror(errno));
 			}
 
+			if (ret > 0) {
+				data.append(buff, ret);
+				shred(buff, sizeof(buff));
+			}
+
 			if ((size_t) ret < sizeof(buff)) {
 				try {
-					data.append(buff, ret);
-					shred(buff, sizeof(buff));
 					XMLObject request = parseXML(data);
 					XMLObject response = module.process(request);
 					cout << generateXML(response) << endl;
 					return 0;
-				} catch ( ... ) {
-					shred(buff, sizeof(buff));
-				}
+				} catch ( ... ) { }
 			}
 			continue;
 		}
+
 		if (poll_data.revents & (POLLERR | POLLHUP | POLLNVAL))
 			throw String("stdin error: ") + String(strerror(errno));
 	} // while


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]