Skip to content

Commit 6a3d69d

Browse files
committed
Some fixes.
1 parent ca12a1b commit 6a3d69d

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/control.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ bool awaitNetPerfMeterAcknowledge(MessageReader* messageReader,
605605
LOG_END
606606
return false;
607607
}
608-
if(!(pfd.revents & POLLIN)) {
608+
if(!(pfd.revents & (POLLIN|POLLERR))) {
609609
LOG_TRACE
610610
stdlog << "<no answer>" << "\n";
611611
LOG_END

src/flowmanager.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ void FlowManager::run()
928928
if(entry) {
929929

930930
// ====== Handle data message ================================
931-
if(entry->revents & POLLIN) {
931+
if(entry->revents & (POLLIN|POLLERR)) {
932932
const int protocol = FlowSet[i]->getTrafficSpec().Protocol;
933933
#ifdef DEBUG_POLL
934934
std::cerr << "\tPOLLIN: flow " << FlowSet[i]->SocketDescriptor
@@ -974,7 +974,7 @@ void FlowManager::run()
974974

975975
// ====== Handle data message =============================
976976
if( (ud->ToBeRemoved == false) &&
977-
(entry->revents & POLLIN) ) {
977+
(entry->revents & (POLLIN|POLLERR)) ) {
978978
#ifdef DEBUG_POLL
979979
std::cerr << "\tPOLLIN: unidentified " << ud->SocketDescriptor
980980
<< " protocol " << ud->Protocol << "\n";

src/netperfmeter.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ bool mainLoop(const bool isActiveMode,
10041004
// ====== Incoming control message ====================================
10051005
int controlID;
10061006
for(controlID = controlIDMin; controlID <= controlIDMax; controlID++) {
1007-
if(fds[controlID].revents & POLLIN) {
1007+
if(fds[controlID].revents & (POLLIN|POLLERR)) {
10081008
if( (isActiveMode == false) &&
10091009
(fds[controlID].fd == gControlSocket) ) {
10101010
const int newSD = ext_accept(gControlSocket, nullptr, 0);
@@ -1057,7 +1057,7 @@ bool mainLoop(const bool isActiveMode,
10571057
}
10581058

10591059
// ====== Incoming data message =======================================
1060-
if( (tcpID >= 0) && (fds[tcpID].revents & POLLIN) ) {
1060+
if( (tcpID >= 0) && (fds[tcpID].revents & (POLLIN|POLLERR)) ) {
10611061
const int newSD = ext_accept(gTCPSocket, nullptr, 0);
10621062
if(newSD >= 0) {
10631063
LOG_TRACE
@@ -1067,7 +1067,7 @@ bool mainLoop(const bool isActiveMode,
10671067
FlowManager::getFlowManager()->addUnidentifiedSocket(IPPROTO_TCP, newSD);
10681068
}
10691069
}
1070-
if( (mptcpID >= 0) && (fds[mptcpID].revents & POLLIN) ) {
1070+
if( (mptcpID >= 0) && (fds[mptcpID].revents & (POLLIN|POLLERR)) ) {
10711071
const int newSD = ext_accept(gMPTCPSocket, nullptr, 0);
10721072
if(newSD >= 0) {
10731073
LOG_TRACE
@@ -1077,12 +1077,12 @@ bool mainLoop(const bool isActiveMode,
10771077
FlowManager::getFlowManager()->addUnidentifiedSocket(IPPROTO_MPTCP, newSD);
10781078
}
10791079
}
1080-
if( (udpID >= 0) && (fds[udpID].revents & POLLIN) ) {
1080+
if( (udpID >= 0) && (fds[udpID].revents & (POLLIN|POLLERR)) ) {
10811081
FlowManager::getFlowManager()->lock();
10821082
handleNetPerfMeterData(isActiveMode, now, IPPROTO_UDP, gUDPSocket);
10831083
FlowManager::getFlowManager()->unlock();
10841084
}
1085-
if( (sctpID >= 0) && (fds[sctpID].revents & POLLIN) ) {
1085+
if( (sctpID >= 0) && (fds[sctpID].revents & (POLLIN|POLLERR)) ) {
10861086
const int newSD = ext_accept(gSCTPSocket, nullptr, 0);
10871087
if(newSD >= 0) {
10881088
LOG_TRACE
@@ -1093,7 +1093,7 @@ bool mainLoop(const bool isActiveMode,
10931093
}
10941094
}
10951095
#ifdef HAVE_DCCP
1096-
if( (dccpID >= 0) && (fds[dccpID].revents & POLLIN) ) {
1096+
if( (dccpID >= 0) && (fds[dccpID].revents & (POLLIN|POLLERR)) ) {
10971097
const int newSD = ext_accept(gDCCPSocket, nullptr, 0);
10981098
if(newSD >= 0) {
10991099
LOG_TRACE

0 commit comments

Comments
 (0)