coap_pdu_duplicate: Revert and fix previous change

This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2023-04-24 09:53:39 +01:00
1 parent ca609d221c
commit c4ce40347f
2 files changed
+5 -4

No files matched your search

+3 -3
View File
@@ -135,7 +135,7 @@ setup_block_b(coap_session_t *session, coap_pdu_t *pdu, coap_block_b_t *block,
if (avail < 16) { /* bad luck, this is the smallest block size */
coap_log_debug(
"not enough space, even the smallest block does not fit\n");
"not enough space, even the smallest block does not fit (1)\n");
return 0;
}
new_blk_size = coap_flsll((long long)avail) - 5;
@@ -669,7 +669,7 @@ coap_add_data_large_internal(coap_session_t *session,
if (avail < 16 && ((ssize_t)length > avail || have_block_defined)) {
/* bad luck, this is the smallest block size */
coap_log_debug(
"not enough space, even the smallest block does not fit\n");
"not enough space, even the smallest block does not fit (2)\n");
goto fail;
}
@@ -838,7 +838,7 @@ coap_add_data_large_internal(coap_session_t *session,
/* chunk size change down */
if (avail < 16) {
coap_log_warn(
"not enough space, even the smallest block does not fit\n");
"not enough space, even the smallest block does not fit (3)\n");
goto fail;
}
blk_size = coap_flsll((long long)avail) - 4 - 1;
+2 -1
View File
@@ -189,7 +189,8 @@ coap_pdu_duplicate(const coap_pdu_t *old_pdu,
session->doing_first = 0;
pdu = coap_pdu_init(old_pdu->type, old_pdu->code,
coap_new_message_id(session),
0);
max(old_pdu->max_size,
coap_session_max_pdu_size(session)));
/* Restore any pending waits */
session->doing_first = doing_first;
if (pdu == NULL)