mirror of
https://github.com/ep00ch/lwip-contrib-mac.git
synced 2024-06-11 09:29:40 +00:00
httpd: ensure tcp_write() isn't called with len==0
This commit is contained in:
parent
2cb9d29591
commit
59c83ef10e
|
@ -610,6 +610,9 @@ http_write(struct tcp_pcb *pcb, const void* ptr, u16_t *length, u8_t apiflags)
|
||||||
err_t err;
|
err_t err;
|
||||||
LWIP_ASSERT("length != NULL", length != NULL);
|
LWIP_ASSERT("length != NULL", length != NULL);
|
||||||
len = *length;
|
len = *length;
|
||||||
|
if (len == 0) {
|
||||||
|
return ERR_OK;
|
||||||
|
}
|
||||||
do {
|
do {
|
||||||
LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("Trying go send %d bytes\n", len));
|
LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("Trying go send %d bytes\n", len));
|
||||||
err = tcp_write(pcb, ptr, len, apiflags);
|
err = tcp_write(pcb, ptr, len, apiflags);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user