mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-22 15:25:14 +03:00
Merge pull request #522 from mrdeep1/block_restriction
net.c: Relax TCP CSM Block-Wise-Transfer tests
This commit is contained in:
1 file changed
+7
-3
@@ -1004,7 +1004,9 @@ coap_send(coap_session_t *session, coap_pdu_t *pdu) {
|
||||
}
|
||||
|
||||
#if !COAP_DISABLE_TCP
|
||||
if (COAP_PROTO_RELIABLE(session->proto) && !session->csm_block_supported) {
|
||||
if (COAP_PROTO_RELIABLE(session->proto) &&
|
||||
session->state == COAP_SESSION_STATE_ESTABLISHED &&
|
||||
!session->csm_block_supported) {
|
||||
/*
|
||||
* Need to check that this instance is not sending any block options as the
|
||||
* remote end via CSM has not informed us that there is support
|
||||
@@ -1014,10 +1016,12 @@ coap_send(coap_session_t *session, coap_pdu_t *pdu) {
|
||||
coap_opt_iterator_t opt_iter;
|
||||
|
||||
if (coap_check_option(pdu, COAP_OPTION_BLOCK1, &opt_iter) != NULL) {
|
||||
goto error;
|
||||
coap_log(LOG_DEBUG,
|
||||
"Remote end did not indicate CSM support for BLOCK1 enabled\n");
|
||||
}
|
||||
if (coap_check_option(pdu, COAP_OPTION_BLOCK2, &opt_iter) != NULL) {
|
||||
goto error;
|
||||
coap_log(LOG_DEBUG,
|
||||
"Remote end did not indicate CSM support for BLOCK2 enabled\n");
|
||||
}
|
||||
}
|
||||
#endif /* !COAP_DISABLE_TCP */
|
||||
|
||||
Reference in new issue
Block a user