Fixed a bug with the path in clientreq. If the path was empty it caused a
malformed request to be sent.
This commit is contained in:
parent
770c71969e
commit
d0a05357a1
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
* src/reqs.c (clientreq): Removed the hack for POST methods with
|
* src/reqs.c (clientreq): Removed the hack for POST methods with
|
||||||
regard to anonymous access.
|
regard to anonymous access.
|
||||||
|
(clientreq): fixed a bug with the request line. If the PATH was
|
||||||
|
empty, it would send an malformed request to the server. This is
|
||||||
|
checked now and if the path is empty, a "/" is used instread.
|
||||||
|
|
||||||
* src/config.h (SOCK_TIMEOUT): Increased the time out to 10
|
* src/config.h (SOCK_TIMEOUT): Increased the time out to 10
|
||||||
seconds.
|
seconds.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: reqs.c,v 1.6 2000-03-31 20:13:36 rjkaes Exp $
|
/* $Id: reqs.c,v 1.7 2000-03-31 22:55:22 rjkaes Exp $
|
||||||
*
|
*
|
||||||
* This is where all the work in tinyproxy is actually done. Incoming
|
* This is where all the work in tinyproxy is actually done. Incoming
|
||||||
* connections are added to the active list of connections and then the header
|
* connections are added to the active list of connections and then the header
|
||||||
@ -230,11 +230,15 @@ static int clientreq(struct conn_s *connptr)
|
|||||||
memcpy(request, inbuf, pmatch[METHOD_IND].rm_eo);
|
memcpy(request, inbuf, pmatch[METHOD_IND].rm_eo);
|
||||||
request[pmatch[METHOD_IND].rm_eo] = '\0';
|
request[pmatch[METHOD_IND].rm_eo] = '\0';
|
||||||
strcat(request, " ");
|
strcat(request, " ");
|
||||||
|
if (strlen(uri->path) > 0) {
|
||||||
strcat(request, uri->path);
|
strcat(request, uri->path);
|
||||||
if (uri->query) {
|
if (uri->query) {
|
||||||
strcat(request, "?");
|
strcat(request, "?");
|
||||||
strcat(request, uri->query);
|
strcat(request, uri->query);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
strcat(request, "/");
|
||||||
|
}
|
||||||
strcat(request, " HTTP/1.0\r\n");
|
strcat(request, " HTTP/1.0\r\n");
|
||||||
|
|
||||||
/* chris - If domain is in dotted-quad format or is already in the
|
/* chris - If domain is in dotted-quad format or is already in the
|
||||||
|
Loading…
Reference in New Issue
Block a user