zephyr/include/net
Michael Scott caa377943a net: http: fix avoiding timeout on HTTP requests w/o body
The original commit 8ebaf29927 ("net: http: dont timeout
on HTTP requests w/o body") was intended to handle a case
where an HTTP response had been retrieved from the server but
the HTTP parser couldn't meet the criteria for calling
"on_message_complete".  For example, a POST to a REST API
where the server doesn't return anything but an HTTP
status code.

It was a really bad idea to check a semaphore count.  There
is a lot of kernel logic built into semaphores and how the
count is adjusted.  The assumption that the value is 0
after the k_sem_give() is incorrect.  It's STILL 0 if
something is pending with a k_sem_take().  By the time
k_sem_give() is done executing the other thread has now
been kicked and the count is back to 0.

This caused the original check to always pass and in turn
breakage was noticed in the http_client sample.

Let's do this the right way by setting a flag when
on_message_complete is called and if that flag is not set
by the time we reach recv_cb, let's give back the semaphore
to avoid a timeout.

Jira: ZEP-2561

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-08-23 16:42:03 -04:00
..
arp.h net: doc: Add missing defgroups to network header files 2017-07-31 20:59:09 +03:00
bt.h net: bt: Add advertise management command 2017-08-04 18:18:40 +03:00
buf.h net: doc: Add missing defgroups to network header files 2017-07-31 20:59:09 +03:00
dhcpv4.h net: Add missing __cplusplus checks to includes 2017-07-24 14:54:34 -04:00
dns_resolve.h net: Add missing __cplusplus checks to includes 2017-07-24 14:54:34 -04:00
ethernet.h net: doc: Add missing defgroups to network header files 2017-07-31 20:59:09 +03:00
http_parser.h http: client: Create a HTTP library 2017-05-04 15:58:45 -04:00
http.h net: http: fix avoiding timeout on HTTP requests w/o body 2017-08-23 16:42:03 -04:00
ieee802154_radio.h net: Fix indentation issues 2017-08-09 16:01:28 +03:00
ieee802154.h net: doc: Add missing defgroups to network header files 2017-07-31 20:59:09 +03:00
lwm2m.h net: lwm2m: add IPSO light control object 2017-08-18 10:53:25 +03:00
mii.h net: doc: Add missing defgroups to network header files 2017-07-31 20:59:09 +03:00
mqtt_types.h net: doc: Add missing defgroups to network header files 2017-07-31 20:59:09 +03:00
mqtt.h kernel: introduce opaque data type for stacks 2017-08-01 16:43:15 -07:00
net_app.h net: app: Introduce missing enable/disable functions for server 2017-08-22 13:33:33 -04:00
net_context.h doc: fix misspellings in include (API docs) 2017-08-10 12:22:19 -04:00
net_core.h kernel: introduce opaque data type for stacks 2017-08-01 16:43:15 -07:00
net_event.h net: doc: Add missing defgroups to network header files 2017-07-31 20:59:09 +03:00
net_if.h doc: fix misspellings in include (API docs) 2017-08-10 12:22:19 -04:00
net_ip.h net: ip: Prevent unaligned exception 2017-08-22 08:23:56 -04:00
net_l2.h net: l2: Declare Bluetooth and Offload L2 drivers public 2017-08-14 11:06:34 +03:00
net_linkaddr.h net: doc: Add missing defgroups to network header files 2017-07-31 20:59:09 +03:00
net_mgmt.h net: Add missing __cplusplus checks to includes 2017-07-24 14:54:34 -04:00
net_offload.h doc: fix misspellings in include (API docs) 2017-08-10 12:22:19 -04:00
net_pkt.h net: tcp: Do not re-send already sent packets 2017-08-16 14:50:57 -04:00
net_stats.h net: doc: Add missing defgroups to network header files 2017-07-31 20:59:09 +03:00
socket.h net: sockets: inet_pton() should return 1 on success 2017-08-10 17:41:47 +03:00
trickle.h net: doc: Add missing defgroups to network header files 2017-07-31 20:59:09 +03:00
udp.h net: doc: Add missing defgroups to network header files 2017-07-31 20:59:09 +03:00
zoap_link_format.h net: doc: Add missing defgroups to network header files 2017-07-31 20:59:09 +03:00
zoap.h net: zoap: use message id for reply matching 2017-08-09 10:55:53 +03:00