summaryrefslogtreecommitdiffstats
path: root/web/server/web_client.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-11-28 04:53:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-11-28 04:53:08 +0000
commit315e0143f65da3485dcbcd2f6a3172a351618aec (patch)
treeb713ae472cffab249c95917c6fb6d242d54e0a87 /web/server/web_client.c
parentAdding upstream version 1.18.1. (diff)
downloadnetdata-315e0143f65da3485dcbcd2f6a3172a351618aec.tar.xz
netdata-315e0143f65da3485dcbcd2f6a3172a351618aec.zip
Adding upstream version 1.19.0.upstream/1.19.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/server/web_client.c')
-rw-r--r--web/server/web_client.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/web/server/web_client.c b/web/server/web_client.c
index 53a5944ce..537152660 100644
--- a/web/server/web_client.c
+++ b/web/server/web_client.c
@@ -340,6 +340,8 @@ static inline int access_to_file_is_not_permitted(struct web_client *w, const ch
return HTTP_RESP_FORBIDDEN;
}
+// Work around a bug in the CMocka library by removing this function during testing.
+#ifndef REMOVE_MYSENDFILE
int mysendfile(struct web_client *w, char *filename) {
debug(D_WEB_CLIENT, "%llu: Looking for file '%s/%s'", w->id, netdata_configured_web_dir, filename);
@@ -448,11 +450,13 @@ int mysendfile(struct web_client *w, char *filename) {
w->response.data->date = statbuf.st_mtimespec.tv_sec;
#else
w->response.data->date = statbuf.st_mtim.tv_sec;
-#endif /* __APPLE__ */
+#endif
buffer_cacheable(w->response.data);
return HTTP_RESP_OK;
}
+#endif
+
#ifdef NETDATA_WITH_ZLIB
@@ -1266,7 +1270,7 @@ static inline void web_client_send_http_header(struct web_client *w) {
while((bytes = SSL_write(w->ssl.conn, buffer_tostring(w->response.header_output), buffer_strlen(w->response.header_output))) < 0) {
count++;
if(count > 100 || (errno != EAGAIN && errno != EWOULDBLOCK)) {
- error("Cannot send HTTP headers to web client.");
+ error("Cannot send HTTPS headers to web client.");
break;
}
}