Dolda2000 GitWeb
/
ashd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
htextauth: Check credentials against control characters that might mess stuff up.
[ashd.git]
/
src
/
htparser.c
diff --git
a/src/htparser.c
b/src/htparser.c
index
4325e97
..
d1b0a1c
100644
(file)
--- a/
src/htparser.c
+++ b/
src/htparser.c
@@
-272,6
+272,9
@@
void serve(FILE *in, struct conn *conn)
if((resp = parseresp(out)) == NULL)
break;
replstr(&resp->ver, req->ver);
if((resp = parseresp(out)) == NULL)
break;
replstr(&resp->ver, req->ver);
+
+ if(!getheader(resp, "server"))
+ headappheader(resp, "Server", sprintf3("ashd/%s", VERSION));
if(!strcmp(req->ver, "HTTP/1.0")) {
writeresp(in, resp);
if(!strcmp(req->ver, "HTTP/1.0")) {
writeresp(in, resp);
@@
-280,8
+283,8
@@
void serve(FILE *in, struct conn *conn)
if(!hasheader(req, "connection", "keep-alive"))
break;
} else if((hd = getheader(resp, "content-length")) != NULL) {
if(!hasheader(req, "connection", "keep-alive"))
break;
} else if((hd = getheader(resp, "content-length")) != NULL) {
- dlen =
passdata(out, in, -1
);
- if(
dlen != atoo(hd)
)
+ dlen =
atoo(hd
);
+ if(
passdata(out, in, dlen) != dlen
)
break;
if(!hasheader(req, "connection", "keep-alive"))
break;
break;
if(!hasheader(req, "connection", "keep-alive"))
break;
@@
-298,8
+301,8
@@
void serve(FILE *in, struct conn *conn)
} else if((hd = getheader(resp, "content-length")) != NULL) {
writeresp(in, resp);
fprintf(in, "\r\n");
} else if((hd = getheader(resp, "content-length")) != NULL) {
writeresp(in, resp);
fprintf(in, "\r\n");
- dlen =
passdata(out, in, -1
);
- if(
dlen != atoo(hd)
)
+ dlen =
atoo(hd
);
+ if(
passdata(out, in, dlen) != dlen
)
break;
} else if(!getheader(resp, "transfer-encoding")) {
headappheader(resp, "Transfer-Encoding", "chunked");
break;
} else if(!getheader(resp, "transfer-encoding")) {
headappheader(resp, "Transfer-Encoding", "chunked");