Skip to content

Commit 2fec28d

Browse files
committed
Improved termination of broken connections.
1 parent cafcaa9 commit 2fec28d

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

src/control.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ static bool uploadOutputFile(const int controlSocket,
793793
std::cerr << "WARNING: Unable to upload results (errno=" << errno << "): "
794794
<< strerror(errno) << "\n";
795795
gOutputMutex.unlock();
796-
sendAbort(controlSocket);
796+
ext_shutdown(controlSocket, 2);
797797
}
798798
if(gOutputVerbosity >= NPFOV_CONNECTIONS) {
799799
gOutputMutex.lock();
@@ -1150,7 +1150,7 @@ bool handleNetPerfMeterControlMessage(MessageReader* messageReader,
11501150
printTimeStamp(std::cerr);
11511151
std::cerr << "ERROR: Control connection is broken!\n";
11521152
gOutputMutex.unlock();
1153-
sendAbort(controlSocket, -1);
1153+
ext_shutdown(controlSocket, 2);
11541154
}
11551155
return(false);
11561156
}
@@ -1201,7 +1201,7 @@ bool handleNetPerfMeterControlMessage(MessageReader* messageReader,
12011201
std::cerr << "ERROR: Received invalid control message of type "
12021202
<< (unsigned int)header->Type << "!\n";
12031203
gOutputMutex.unlock();
1204-
sendAbort(controlSocket);
1204+
ext_shutdown(controlSocket, 2);
12051205
return(false);
12061206
}
12071207
}

src/flow.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ void FlowManager::run()
839839
iterator->first) == 0) {
840840
// Incoming connection has already been closed -> remove it!
841841
gOutputMutex.lock();
842+
printTimeStamp(std::cout);
842843
std::cout << "NOTE: Shutdown of still unidentified incoming connection "
843844
<< iterator->first << "!\n";
844845
gOutputMutex.unlock();

src/messagereader.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
#include "tools.h"
3232

3333

34-
// #define DEBUG_SOCKETS
35-
// #define DEBUG_MESSAGEREADER
34+
#define DEBUG_SOCKETS
35+
#define DEBUG_MESSAGEREADER
3636

3737

3838

src/transfer.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ ssize_t handleNetPerfMeterData(const bool isActiveMode,
278278
printAddress(std::cout, &from.sa, true);
279279
std::cout << " on socket " << sd << "!\n";
280280
gOutputMutex.unlock();
281+
ext_shutdown(sd, 2);
281282
}
282283
}
283284
else {
@@ -287,6 +288,7 @@ ssize_t handleNetPerfMeterData(const bool isActiveMode,
287288
printAddress(std::cout, &from.sa, true);
288289
std::cout << " on socket " << sd << "!\n";
289290
gOutputMutex.unlock();
291+
ext_shutdown(sd, 2);
290292
}
291293
}
292294

@@ -301,6 +303,7 @@ ssize_t handleNetPerfMeterData(const bool isActiveMode,
301303
std::cout << " on socket " << sd << "!\n";
302304
gOutputMutex.unlock();
303305
flow->unlock();
306+
ext_shutdown(sd, 2);
304307
}
305308
flow->endOfInput();
306309
}

0 commit comments

Comments
 (0)