Skip to content

Commit

Permalink
a failing recv is now fatal for the tcp-connection
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertvanheusden committed Oct 27, 2024
1 parent b5499be commit ba5d6eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ std::tuple<iscsi_pdu_bhs *, iscsi_fail_reason, uint64_t> server::receive_pdu(com
uint8_t *ahs_temp = new uint8_t[ahs_len]();
if (cc->recv(ahs_temp, ahs_len) == false) {
ok = false;
pdu_error = IFR_CONNECTION;
DOLOG(logging::ll_info, "server::receive_pdu", cc->get_endpoint_name(), "AHS receive error");
}
else {
Expand All @@ -176,6 +177,7 @@ std::tuple<iscsi_pdu_bhs *, iscsi_fail_reason, uint64_t> server::receive_pdu(com

if (cc->recv(reinterpret_cast<uint8_t *>(&remote_header_digest), sizeof remote_header_digest) == false) {
ok = false;
pdu_error = IFR_CONNECTION;
DOLOG(logging::ll_info, "server::receive_pdu", cc->get_endpoint_name(), "header digest receive error");
}
else {
Expand Down Expand Up @@ -204,6 +206,7 @@ std::tuple<iscsi_pdu_bhs *, iscsi_fail_reason, uint64_t> server::receive_pdu(com
uint8_t *data_temp = new uint8_t[padded_data_length]();
if (cc->recv(data_temp, padded_data_length) == false) {
ok = false;
pdu_error = IFR_CONNECTION;
DOLOG(logging::ll_info, "server::receive_pdu", cc->get_endpoint_name(), "data receive error");
}
else {
Expand All @@ -222,6 +225,7 @@ std::tuple<iscsi_pdu_bhs *, iscsi_fail_reason, uint64_t> server::receive_pdu(com

if (cc->recv(reinterpret_cast<uint8_t *>(&remote_data_digest), sizeof remote_data_digest) == false) {
ok = false;
pdu_error = IFR_CONNECTION;
DOLOG(logging::ll_info, "server::receive_pdu", cc->get_endpoint_name(), "data digest receive error");
}
else {
Expand Down

0 comments on commit ba5d6eb

Please sign in to comment.