zephyr/include
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
..
arch arch: arc: apply STACK_GUARD_SIZE and optimize the mpu driver 2017-08-16 16:09:45 -04:00
bluetooth Bluetooth: VS: Replace IRK with IR 2017-08-17 12:36:51 +02:00
crypto crypto: Remove useless attribute 2017-04-27 13:06:31 +00:00
debug object_tracing: fix definition 2017-08-16 10:59:10 -07:00
display doc: spelling check doxygen comments include/ 2017-05-02 22:21:37 -04:00
drivers pwm: Remove k64-specific driver and k20_sim.h 2017-08-09 18:13:29 -04:00
dt-bindings i2c: Cleanup dts clock-frequency property usage 2017-08-16 10:03:34 -05:00
fs license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
linker arm: armv6-m: Support relocating vector table 2017-08-09 18:13:29 -04:00
logging doc: spelling check doxygen comments include/ 2017-05-02 22:21:37 -04:00
misc misc/byteorder: add support for __bswap_64 2017-08-09 10:55:53 +03:00
net net: http: fix avoiding timeout on HTTP requests w/o body 2017-08-23 16:42:03 -04:00
shell shell: Add define to _SHELL_H_ 2017-06-09 18:54:27 -04:00
toolchain xcc: fix __in_section_unique() and __COUNTER__ 2017-08-16 10:59:10 -07:00
usb doc: spelling check doxygen comments include/ 2017-05-02 22:21:37 -04:00
zephyr Introduce new sized integer typedefs 2017-04-20 16:07:08 +00:00
adc.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
aio_comparator.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
atomic.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
cache.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
clock_control.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
console.h doc: fix misspellings in include (API docs) 2017-08-10 12:22:19 -04:00
counter.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
crc16.h drivers: crc: Add 'pad' parameter to crc16() 2017-08-17 22:19:19 -04:00
device.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
disk_access.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
dma.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
eth.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
flash.h Introduce new sized integer typedefs 2017-04-20 16:07:08 +00:00
fs.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
gpio.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
i2c.h i2c: Add define for bit position/shift of I2C SPEED settings in config 2017-08-16 10:03:34 -05:00
i2s.h drivers: Add I2S (Inter-IC Sound) driver API 2017-08-14 11:14:34 -04:00
init.h kernel: remove deprecated init levels 2017-04-07 17:45:34 +00:00
ipm.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
irq_offload.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
irq.h irq.h: include generic toolchain header 2017-08-16 10:59:10 -07:00
kernel_version.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
kernel.h work_q: Make k_delayed_work_cancel cancel work already pending 2017-08-15 08:49:09 -04:00
pinmux.h pinmux: Allow up to 6 functions 2017-08-09 12:26:14 -07:00
power.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
pthread.h kernel: POSIX thread IPC support 2017-08-15 19:42:07 -04:00
pwm.h drivers: pwm: Remove all deprecated APIs. 2017-08-09 12:31:03 -07:00
random.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
rtc.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
sensor.h include: Add new sensor channel blue 2017-08-03 15:29:35 -05:00
shared_irq.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
spi_legacy.h api: New SPI API 2017-05-19 18:52:25 -04:00
spi.h doc: fix misspellings in include (API docs) 2017-08-10 12:22:19 -04:00
sw_isr_table.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
sys_clock.h kernel: tickless: Add tickless kernel support 2017-04-27 13:46:28 +00:00
sys_io.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
toolchain.h xtensa: move byte-order macros out of arch.h 2017-05-11 12:47:23 -04:00
uart.h drivers: serial: Clarification for uart_fifo_fill()/read() calls 2017-05-30 20:53:13 -04:00
watchdog.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
zephyr.h kernel: remove legacy.h and MDEF support 2017-04-19 10:59:35 -05:00