* strip \r off on line end before \n

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@25606 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Dave Wetzel 2007-11-25 10:03:55 +00:00
parent be15a70bff
commit 250ed2c524
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2007-11-25 David Wetzel <dave@turbocat.de>
* GSWAdaptors/Apache2/mod_gsw.c
Works also if a header or empty line at the end of the headers has a \r\n ending.
2007-11-24 David Ayers <ayers@fsfe.org>
* GSWeb.framework/GSWApplication+Defaults.m

View file

@ -664,6 +664,9 @@ void * read_sock_line(int socket, request_rec *r, apr_pool_t * pool)
if (b == '\n') {
done = 1;
buffer[i] = '\0';
if ((i>0) && (buffer[i-1] == '\r')) {
buffer[i-1] = '\0';
}
}
i++;
}
@ -696,7 +699,6 @@ void * read_sock(int socket, size_t size, apr_pool_t * pool)
}
/*
HTTP/1.0 200 OK NeXT WebObjects
x-webobjects-loadaverage: 1
@ -836,6 +838,7 @@ static int handle_request(request_rec *r, gsw_app_conf * app)
if (content_encoding == NULL) {
if (strncmp(newBuf, "content-encoding: ", 18) == 0) {
content_encoding = newBuf+18;
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "content-encoding: %s", content_encoding);
apr_table_set(r->headers_out, "content-encoding", content_encoding);
}