summaryrefslogtreecommitdiffstats
path: root/libvncserver
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2011-11-17 17:03:45 +0100
committerChristian Beier <dontmind@freeshell.org>2011-11-17 17:03:45 +0100
commit49e59435e32401dcaa7885bab1d2e49b5b2efaf9 (patch)
treedf0b4dbc4cc52942df7e629483efb8c2c327f00b /libvncserver
parentefdb2f06d4803c76871e4b5b5958584c0be9cc3a (diff)
parentbdd7e25d2dd47c3a5d8c95366bc111dc0a176128 (diff)
downloadlibtdevnc-49e59435e32401dcaa7885bab1d2e49b5b2efaf9.tar.gz
libtdevnc-49e59435e32401dcaa7885bab1d2e49b5b2efaf9.zip
Merge branch 'included-novnc'
Diffstat (limited to 'libvncserver')
-rw-r--r--libvncserver/httpd.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/libvncserver/httpd.c b/libvncserver/httpd.c
index ad2a51b..3025aae 100644
--- a/libvncserver/httpd.c
+++ b/libvncserver/httpd.c
@@ -59,20 +59,6 @@
#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"
-
-#define INVALID_REQUEST_STR "HTTP/1.0 400 Invalid Request\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\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" \
@@ -82,9 +68,10 @@
"<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"
+#define OK_STR "HTTP/1.0 200 OK\r\nConnection: close\r\n\r\n"
+#define OK_STR_HTML "HTTP/1.0 200 OK\r\nConnection: close\r\nContent-Type: text/html\r\n\r\n"
+
-#endif
static void httpProcessInput(rfbScreenInfoPtr screen);
static rfbBool compareAndSkip(char **ptr, const char *str);
@@ -346,12 +333,6 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
return;
}
- if (strchr(fname+1, '/') != NULL) {
- rfbErr("httpd: asking for file in other directory\n");
- rfbWriteExact(&cl, NOT_FOUND_STR, strlen(NOT_FOUND_STR));
- httpCloseSock(rfbScreen);
- return;
- }
getpeername(rfbScreen->httpSock, (struct sockaddr *)&addr, &addrlen);
rfbLog("httpd: get '%s' for %s\n", fname+1,
@@ -392,7 +373,10 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
return;
}
- rfbWriteExact(&cl, OK_STR, strlen(OK_STR));
+ if(performSubstitutions) /* is the 'index.vnc' file */
+ rfbWriteExact(&cl, OK_STR_HTML, strlen(OK_STR_HTML));
+ else
+ rfbWriteExact(&cl, OK_STR, strlen(OK_STR));
while (1) {
int n = fread(buf, 1, BUF_SIZE-1, fd);