summaryrefslogtreecommitdiffstats
path: root/httpd.c
diff options
context:
space:
mode:
authordscho <dscho>2001-10-11 15:44:58 +0000
committerdscho <dscho>2001-10-11 15:44:58 +0000
commit67094d7c281993497decb1459ea1663765a760eb (patch)
tree6317d81c1ddca58b5e3b8e1556ae9b904e0d160b /httpd.c
parent519a8e0e399bf44893f2d61a3676f3257ab8d201 (diff)
downloadlibtdevnc-67094d7c281993497decb1459ea1663765a760eb.tar.gz
libtdevnc-67094d7c281993497decb1459ea1663765a760eb.zip
replaced xalloc with malloc functions, udp input support (untested), fixed http
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/httpd.c b/httpd.c
index 7d92812..fd00ec2 100644
--- a/httpd.c
+++ b/httpd.c
@@ -45,7 +45,7 @@
"<HEAD><TITLE>File Not Found</TITLE></HEAD>\n" \
"<BODY><H1>File Not Found</H1></BODY>\n"
-#define OK_STR "HTTP/1.0 200 OK\n\n"
+#define OK_STR "HTTP/1.0 200 OK\nContent-Type: text/html\n\n"
static void httpProcessInput();
static Bool compareAndSkip(char **ptr, const char *str);
@@ -273,7 +273,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
/* Open the file */
- if ((fd = fopen(fullFname, O_RDONLY)) < 0) {
+ if ((fd = fopen(fullFname, "r")) <= 0) {
rfbLogPerror("httpProcessInput: open");
WriteExact(&cl, NOT_FOUND_STR, strlen(NOT_FOUND_STR));
httpCloseSock(rfbScreen);
@@ -283,7 +283,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
WriteExact(&cl, OK_STR, strlen(OK_STR));
while (1) {
- int n = fread(buf, BUF_SIZE-1, 1, fd);
+ int n = fread(buf, 1, BUF_SIZE-1, fd);
if (n < 0) {
rfbLogPerror("httpProcessInput: read");
fclose(fd);