summaryrefslogtreecommitdiff
path: root/src/reqs.c
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2000-03-31 22:55:22 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2000-03-31 22:55:22 +0000
commitd0a05357a1f6d15179f0d1d7d1da8b674f7f8034 (patch)
tree019e4ce0f62279bb3973936178d8bbc14468488a /src/reqs.c
parent770c71969eb5307bd540e871111be94af727939d (diff)
downloadtinyproxy-d0a05357a1f6d15179f0d1d7d1da8b674f7f8034.tar.gz
tinyproxy-d0a05357a1f6d15179f0d1d7d1da8b674f7f8034.zip
Fixed a bug with the path in clientreq. If the path was empty it caused a
malformed request to be sent.
Diffstat (limited to 'src/reqs.c')
-rw-r--r--src/reqs.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/reqs.c b/src/reqs.c
index bf5fca4..0c33e19 100644
--- a/src/reqs.c
+++ b/src/reqs.c
@@ -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
* connections are added to the active list of connections and then the header
@@ -230,10 +230,14 @@ static int clientreq(struct conn_s *connptr)
memcpy(request, inbuf, pmatch[METHOD_IND].rm_eo);
request[pmatch[METHOD_IND].rm_eo] = '\0';
strcat(request, " ");
- strcat(request, uri->path);
- if (uri->query) {
- strcat(request, "?");
- strcat(request, uri->query);
+ if (strlen(uri->path) > 0) {
+ strcat(request, uri->path);
+ if (uri->query) {
+ strcat(request, "?");
+ strcat(request, uri->query);
+ }
+ } else {
+ strcat(request, "/");
}
strcat(request, " HTTP/1.0\r\n");