httpd: ensure tcp_write() isn't called with len==0

This commit is contained in:
Simon Goldschmidt 2012-02-22 20:55:27 +01:00
parent 2cb9d29591
commit 59c83ef10e
1 changed files with 3 additions and 0 deletions

View File

@ -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);