From b8d3f5690d2a9d93d7065d058d6df00621bc50f8 Mon Sep 17 00:00:00 2001
From: onefang
Date: Mon, 18 May 2020 14:18:56 +1000
Subject: Don't add two user queries.
---
src/sledjchisl/sledjchisl.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
(limited to 'src/sledjchisl/sledjchisl.c')
diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c
index 02bebe6..00c4c19 100644
--- a/src/sledjchisl/sledjchisl.c
+++ b/src/sledjchisl/sledjchisl.c
@@ -410,7 +410,7 @@ struct _reqData
{
lua_State *L;
qhashtbl_t *configs, *queries, *body, *cookies, *headers, *valid, *stuff, *database, *Rcookies, *Rheaders;
- char *Scheme, *Host, *Method, *Script, *RUri, *doit, *form, *output, *outQuery;
+ char *Scheme, *Host, *Method, *Script, *Path, *RUri, *doit, *form, *output, *outQuery;
sesh shs, *lnk;
MYSQL *db;
gridStats *stats;
@@ -4928,7 +4928,7 @@ static void accountWebHeaders(reqData *Rd, inputForm *oF) //, char *name)
{
char *nm = qstrreplace("tr", xstrdup(Rd->shs.name), " ", "+");
- Rd->reply->addstrf(Rd->reply, "
You are %s
\n", Rd->Host, Rd->RUri, nm, Rd->shs.name);
+ Rd->reply->addstrf(Rd->reply, "You are %s
\n", Rd->Host, Rd->Script, Rd->Path, nm, Rd->shs.name);
Rd->reply->addstr(Rd->reply, linky);
free(nm);
}
@@ -5649,7 +5649,7 @@ static void accountExploreValidatedVouchersWeb(reqData *Rd, inputForm *oF, input
qhashtbl_t *tnm = *((qhashtbl_t **) obj.data);
char *nm = qstrreplace("tr", xstrdup(obj.name), " ", "+");
- Rd->reply->addstrf(Rd->reply, "%s | ", Rd->Host, Rd->RUri, nm, obj.name);
+ Rd->reply->addstrf(Rd->reply, "
%s | ", Rd->Host, Rd->Script, Rd->Path, nm, obj.name);
Rd->reply->addstrf(Rd->reply, "%s | %s | %s |
", getStrH(tnm, "voucher"), getStrH(tnm, "level"), getStrH(tnm, "title"));
free(nm);
tnm->clear(tnm);
@@ -6860,8 +6860,8 @@ if ((strcmp("HTTP_COOKIE", ky) == 0) || (strcmp("CONTENT_LENGTH", ky) == 0) || (
// The FCGI paramaters sent from the server, are converted to environment variablse for the fcgi2 SDK.
// The FCGI spec doesn't mention what these are. except FCGI_WEB_SERVER_ADDRS.
char *Role = Rd->headers->getstr(Rd->headers, "FCGI_ROLE", false);
- char *Path = Rd->headers->getstr(Rd->headers, "PATH_INFO", false);
-// if (NULL == Path) {msleep(1000); continue;}
+ Rd->Path = Rd->headers->getstr(Rd->headers, "PATH_INFO", false);
+// if (NULL == Rd->Path) {msleep(1000); continue;}
char *Length = Rd->headers->getstr(Rd->headers, "CONTENT_LENGTH", false);
//char *Type = Rd->headers->getstr(Rd->headers, "CONTENT_TYPE", false);
Rd->Method = Rd->headers->getstr(Rd->headers, "REQUEST_METHOD", false);
@@ -6906,7 +6906,7 @@ t("QUERY");
T("ignoring QUERY");
Rd->queries = qhashtbl(0, 0);
free(Rd->RUri);
- Rd->RUri = xmprintf("%s%s", Rd->Script, Path);
+ Rd->RUri = xmprintf("%s%s", Rd->Script, Rd->Path);
}
t("BODY");
char *Body = NULL;
@@ -6927,10 +6927,10 @@ t("BODY");
free(Body);
santize(Rd->body);
- I("%s %s://%s%s -> %s%s", Rd->Method, Rd->Scheme, Rd->Host, Rd->RUri, webRoot, Path);
+ I("%s %s://%s%s -> %s%s", Rd->Method, Rd->Scheme, Rd->Host, Rd->RUri, webRoot, Rd->Path);
D("Started FCGI web request ROLE = %s, body is %s bytes, pid %d.", Role, Length, getpid());
- if (NULL == Path)
+ if (NULL == Rd->Path)
{
E("NULL path in FCGI request!");
Rd->Rheaders->putstr(Rd->Rheaders, "Status", "404 Not Found");
@@ -6991,11 +6991,11 @@ t("BODY");
}
memset(toybuf, 0, sizeof(toybuf));
- snprintf(toybuf, sizeof(toybuf), "%s%s", webRoot, Path);
+ snprintf(toybuf, sizeof(toybuf), "%s%s", webRoot, Rd->Path);
HTMLfile *thisFile = checkHTMLcache(toybuf);
if (NULL == thisFile)
{
- dynPage *dp = dynPages->get(dynPages, &Path[1], NULL, false);
+ dynPage *dp = dynPages->get(dynPages, &Rd->Path[1], NULL, false);
if (NULL == dp)
{
E("Can't access file %s", toybuf);
--
cgit v1.1