Skip to content

Commit

Permalink
Revert "Show malformed protocol commands in transfer view"
Browse files Browse the repository at this point in the history
This reverts commit 5502ac9.

Showing malformed/binary data may cause issues
  • Loading branch information
maksis committed Sep 19, 2021
1 parent 3acdaab commit 07d8a07
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions airdcpp/airdcpp/UserConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ void UserConnection::on(BufferedSocketListener::Line, const string& aLine) noexc

COMMAND_DEBUG(aLine, DebugManager::TYPE_CLIENT, DebugManager::INCOMING, getRemoteIp());

if (aLine.length() < 2) {
fire(UserConnectionListener::ProtocolError(), this, STRING(MALFORMED_DATA) + " (" + aLine + ")");
if(aLine.length() < 2) {
fire(UserConnectionListener::ProtocolError(), this, STRING(MALFORMED_DATA));
return;
}

if (aLine[0] == 'C' && !isSet(FLAG_NMDC)) {
if(aLine[0] == 'C' && !isSet(FLAG_NMDC)) {
if(!Text::validateUtf8(aLine)) {
fire(UserConnectionListener::ProtocolError(), this, STRING(UTF_VALIDATION_ERROR));
return;
Expand All @@ -75,7 +75,7 @@ void UserConnection::on(BufferedSocketListener::Line, const string& aLine) noexc
setFlag(FLAG_NMDC);
} else {
// We shouldn't be here?
fire(UserConnectionListener::ProtocolError(), this, STRING(MALFORMED_DATA) + " (" + aLine + ")");
fire(UserConnectionListener::ProtocolError(), this, STRING(MALFORMED_DATA));
return;
}

Expand Down Expand Up @@ -146,7 +146,7 @@ void UserConnection::on(BufferedSocketListener::Line, const string& aLine) noexc
fire(UserConnectionListener::ListLength(), this, param);
}
} else {
fire(UserConnectionListener::ProtocolError(), this, STRING(MALFORMED_DATA) + " (" + cmd + ")");
fire(UserConnectionListener::ProtocolError(), this, STRING(MALFORMED_DATA));
}
}

Expand Down

0 comments on commit 07d8a07

Please sign in to comment.