update: fixing the debug messages for client functions
This commit is contained in:
@ -66,7 +66,7 @@ bool lm_mptp_client_send(int sock, lm_mptp_t *packet) {
|
||||
}
|
||||
|
||||
char buffer[sizeof(packet->header) + packet->header.host_size + packet->header.data_size];
|
||||
ssize_t total = sizeof(buffer), used = 0;
|
||||
ssize_t total = sizeof(buffer), used = 0, buflen = total;
|
||||
|
||||
packet->header.flags = htons(packet->header.flags);
|
||||
|
||||
@ -74,14 +74,14 @@ bool lm_mptp_client_send(int sock, lm_mptp_t *packet) {
|
||||
copy_to_buffer(buffer, packet->host, packet->header.host_size, &total, &used);
|
||||
copy_to_buffer(buffer, packet->data, packet->header.data_size, &total, &used);
|
||||
|
||||
pdebug(__func__, "printing the packet dump");
|
||||
pdebug_binary(buffer, sizeof(buffer));
|
||||
|
||||
if (send(sock, buffer, sizeof(buffer), 0) < 0) {
|
||||
lm_error_set(LM_ERR_MPTPSendFail);
|
||||
return false;
|
||||
}
|
||||
|
||||
pdebug(__func__, "printing the packet dump (%lu bytes)", buflen);
|
||||
pdebug_binary(buffer, buflen);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user