Skip to content

Commit

Permalink
only do data digest if check is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertvanheusden committed Oct 10, 2024
1 parent a9ff96a commit 226d29b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ std::tuple<iscsi_pdu_bhs *, bool, uint64_t> server::receive_pdu(com_client *cons
else {
pdu_obj->set_data({ data_temp, data_length });
}
auto incoming_crc32c = crc32_0x11EDC6F41(data_temp, padded_data_length, { });
std::pair<uint32_t, uint32_t> incoming_crc32c { };
if (digest_chk)
incoming_crc32c = crc32_0x11EDC6F41(data_temp, padded_data_length, { });
delete [] data_temp;

(*ses)->add_bytes_rx(padded_data_length);
Expand Down

0 comments on commit 226d29b

Please sign in to comment.