summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrunge <runge>2007-03-20 23:26:33 +0000
committerrunge <runge>2007-03-20 23:26:33 +0000
commitf57eb8742f69fa49e487379affe93ba14cef3dc3 (patch)
tree9d5186d0aade8ef071223faabddecf1a9dedcb5a
parent61cd498fb21b5b2a3f63f336b1f1ed297f451c22 (diff)
downloadlibtdevnc-f57eb8742f69fa49e487379affe93ba14cef3dc3.tar.gz
libtdevnc-f57eb8742f69fa49e487379affe93ba14cef3dc3.zip
Add "Connection: close" to HTTP replies.
-rw-r--r--ChangeLog3
-rwxr-xr-xlibvncserver/httpd.c17
2 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b2f7a1d..7cdf02e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2007-03-20 Karl Runge <[email protected]>
+ * libvncserver/httpd.c: Add "Connection: close" to HTTP replies.
+
2007-03-17 Charles Coffing <[email protected]>
* libvncserver: fix a locking issue
diff --git a/libvncserver/httpd.c b/libvncserver/httpd.c
index a78cf73..c183543 100755
--- a/libvncserver/httpd.c
+++ b/libvncserver/httpd.c
@@ -59,6 +59,9 @@
#include <tcpd.h>
#endif
+#define connection_close
+#ifndef connection_close
+
#define NOT_FOUND_STR "HTTP/1.0 404 Not found\r\n\r\n" \
"<HEAD><TITLE>File Not Found</TITLE></HEAD>\n" \
"<BODY><H1>File Not Found</H1></BODY>\n"
@@ -67,10 +70,20 @@
"<HEAD><TITLE>Invalid Request</TITLE></HEAD>\n" \
"<BODY><H1>Invalid request</H1></BODY>\n"
-#if 1
#define OK_STR "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n"
+
#else
+
+#define NOT_FOUND_STR "HTTP/1.0 404 Not found\r\nConnection: close\r\n\r\n" \
+ "<HEAD><TITLE>File Not Found</TITLE></HEAD>\n" \
+ "<BODY><H1>File Not Found</H1></BODY>\n"
+
+#define INVALID_REQUEST_STR "HTTP/1.0 400 Invalid Request\r\nConnection: close\r\n\r\n" \
+ "<HEAD><TITLE>Invalid Request</TITLE></HEAD>\n" \
+ "<BODY><H1>Invalid request</H1></BODY>\n"
+
#define OK_STR "HTTP/1.0 200 OK\r\nConnection: close\r\nContent-Type: text/html\r\n\r\n"
+
#endif
static void httpProcessInput(rfbScreenInfoPtr screen);
@@ -332,7 +345,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
return;
}
- if (sscanf(buf, "GET %s HTTP/1.0", fname) != 1) {
+ if (sscanf(buf, "GET %s HTTP/1.", fname) != 1) {
rfbErr("httpd: couldn't parse GET line\n");
httpCloseSock(rfbScreen);
return;