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
debug object_tracing: fix definition 2017-08-16 10:59:10 -07:00
display
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
linker arm: armv6-m: Support relocating vector table 2017-08-09 18:13:29 -04:00
logging
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
zephyr
adc.h
aio_comparator.h
atomic.h
cache.h
clock_control.h
console.h doc: fix misspellings in include (API docs) 2017-08-10 12:22:19 -04:00
counter.h
crc16.h drivers: crc: Add 'pad' parameter to crc16() 2017-08-17 22:19:19 -04:00
device.h
disk_access.h
dma.h
eth.h
flash.h
fs.h
gpio.h
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
ipm.h
irq.h irq.h: include generic toolchain header 2017-08-16 10:59:10 -07:00
irq_offload.h
kernel.h work_q: Make k_delayed_work_cancel cancel work already pending 2017-08-15 08:49:09 -04:00
kernel_version.h
pinmux.h pinmux: Allow up to 6 functions 2017-08-09 12:26:14 -07:00
power.h
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
rtc.h
sensor.h include: Add new sensor channel blue 2017-08-03 15:29:35 -05:00
shared_irq.h
spi.h doc: fix misspellings in include (API docs) 2017-08-10 12:22:19 -04:00
spi_legacy.h
sw_isr_table.h
sys_clock.h
sys_io.h
toolchain.h
uart.h
watchdog.h
zephyr.h