mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-15 04:39:42 +03:00
Merge pull request #142 from mrdeep1/coap-write-missing-tls
coap_write can assert if s->tls is not set when determining next to resend packet
This commit is contained in:
1 file changed
+4
-4
+4
-4
@@ -1108,9 +1108,9 @@ coap_write(coap_context_t *ctx,
|
||||
if (s->proto == COAP_PROTO_DTLS && s->tls) {
|
||||
coap_tick_t tls_timeout = coap_dtls_get_timeout(s);
|
||||
while (tls_timeout > 0 && tls_timeout <= now) {
|
||||
debug("** %s: DTLS retransmit timeout\n", coap_session_str(s));
|
||||
coap_log(LOG_DEBUG, "** %s: DTLS retransmit timeout\n", coap_session_str(s));
|
||||
coap_dtls_handle_timeout(s);
|
||||
tls_timeout = coap_dtls_get_timeout(s);
|
||||
tls_timeout = s->tls ? coap_dtls_get_timeout(s) : 0;
|
||||
}
|
||||
if (tls_timeout > 0 && (timeout == 0 || tls_timeout - now < timeout))
|
||||
timeout = tls_timeout - now;
|
||||
@@ -1122,9 +1122,9 @@ coap_write(coap_context_t *ctx,
|
||||
if (s->proto == COAP_PROTO_DTLS && s->tls) {
|
||||
coap_tick_t tls_timeout = coap_dtls_get_timeout(s);
|
||||
while (tls_timeout > 0 && tls_timeout <= now) {
|
||||
debug("** %s: DTLS retransmit timeout\n", coap_session_str(s));
|
||||
coap_log(LOG_DEBUG, "** %s: DTLS retransmit timeout\n", coap_session_str(s));
|
||||
coap_dtls_handle_timeout(s);
|
||||
tls_timeout = coap_dtls_get_timeout(s);
|
||||
tls_timeout = s->tls ? coap_dtls_get_timeout(s) : 0;
|
||||
}
|
||||
if (tls_timeout > 0 && (timeout == 0 || tls_timeout - now < timeout))
|
||||
timeout = tls_timeout - now;
|
||||
|
||||
Reference in new issue
Block a user