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;
|
||||
LWIP_ASSERT("length != NULL", length != NULL);
|
||||
len = *length;
|
||||
if (len == 0) {
|
||||
return ERR_OK;
|
||||
}
|
||||
do {
|
||||
LWIP_DEBUGF(HTTPD_DEBUG | LWIP_DBG_TRACE, ("Trying go send %d bytes\n", len));
|
||||
err = tcp_write(pcb, ptr, len, apiflags);
|
||||
|
|
Loading…
Reference in New Issue