[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] Patch: avoid sending Content-Length header for async file
From: |
Giuseppe Modugno |
Subject: |
[lwip-devel] Patch: avoid sending Content-Length header for async file |
Date: |
Fri, 24 Nov 2017 16:35:54 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
diff --git a/src/apps/httpd/httpd.c b/src/apps/httpd/httpd.c
index 0ac8d49..112c7a8 100644
--- a/src/apps/httpd/httpd.c
+++ b/src/apps/httpd/httpd.c
@@ -936,7 +936,7 @@ get_http_headers(struct http_state *hs, const char *uri)
add_content_len = 0; /* @todo: get maximum file length from SSI */
} else
#endif /* LWIP_HTTPD_SSI */
- if ((hs->handle == NULL) ||
+ if ((hs->handle == NULL) || (hs->handle->data == NULL) ||
((hs->handle->flags & (FS_FILE_FLAGS_HEADER_INCLUDED |
FS_FILE_FLAGS_HEADER_PERSISTENT)) == FS_FILE_FLAGS_HEADER_INCLUDED)) {
add_content_len = 0;
}
I think it's better to check hs->handle->data too. If it is NULL, we
have no data yet, so we can't send Content Length header.
- [lwip-devel] Patch: avoid sending Content-Length header for async file,
Giuseppe Modugno <=