conga/ricci/common Module.cpp
CVSROOT: /cvs/cluster
Module name: conga
Branch: EXPERIMENTAL
Changes by: rmccabe at sourceware.org 2007-06-18 03:54:09
Modified files:
ricci/common : Module.cpp
Log message:
duh.
ricci/common/Module.cpp +10 -6
@@ -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