mirror of
https://github.com/obgm/libcoap.git
synced 2026-12-05 20:02:19 +03:00
net.c: bugfix: call coap_read_endpoint() only when data available
coap_read_endpoint() should not be called when no data is available on the attached endpoint.
This commit is contained in:
1 parent
467284605d
commit
2c8da3586a
1 file changed
+3
-1
@@ -917,7 +917,9 @@ coap_read(coap_context_t *ctx) {
|
||||
* help with anything, so we set it simply to the last return value
|
||||
* retrieved from coap_read_endpoint(). */
|
||||
LL_FOREACH_SAFE(ctx->endpoint, ep, tmp) {
|
||||
result = coap_read_endpoint(ctx, ep);
|
||||
if ((ep->flags & COAP_ENDPOINT_HAS_DATA) != 0) {
|
||||
result = coap_read_endpoint(ctx, ep);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in new issue
Block a user