X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fparamhandling.c;h=d3c9507b2aa7a6b91fbc87639e50c8139353889d;hb=32b7b8ba5ec4d8c4af7ca65f0db33f7fd1288ce1;hp=8b36c277e39d2463049a6ddb35a276e19a7da85f;hpb=a34ddef79cd50ffc367fc8b99fba6643d67cd5d3;p=citadel.git diff --git a/webcit/paramhandling.c b/webcit/paramhandling.c index 8b36c277e..d3c9507b2 100644 --- a/webcit/paramhandling.c +++ b/webcit/paramhandling.c @@ -1,5 +1,15 @@ /* * parse urlparts and post data + * + * Copyright (c) 1996-2012 by the citadel.org team + * + * This program is open source software. You can redistribute it and/or + * modify it under the terms of the GNU General Public License, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ #include "webcit.h" @@ -41,7 +51,7 @@ void ParseURLParams(StrBuf *url) } keylen = aptr - up - 1; /* -1 -> '=' */ if(keylen > sizeof(u->url_key)) { - lprintf(1, "URLkey to long! [%s]", up); + syslog(1, "invalid url_key"); continue; } @@ -49,7 +59,7 @@ void ParseURLParams(StrBuf *url) memcpy(u->url_key, up, keylen); u->url_key[keylen] = '\0'; if (keylen < 0) { - lprintf(1, "URLkey to long! [%s]", up); + syslog(1, "invalid url_key"); free(u); continue; } @@ -61,7 +71,7 @@ void ParseURLParams(StrBuf *url) u->url_data = NewStrBufPlain(aptr, len); StrBufUnescape(u->url_data, 1); #ifdef DEBUG_URLSTRINGS - lprintf(9, "%s = [%ld] %s\n", + syslog(9, "%s = [%d] %s\n", u->url_key, StrLength(u->url_data), ChrPtr(u->url_data)); @@ -71,7 +81,7 @@ void ParseURLParams(StrBuf *url) len = bptr - aptr; u->url_data = NewStrBufPlain(aptr, len); StrBufUnescape(u->url_data, 1); - lprintf(1, "REJECTED because of __ is internal only: %s = [%ld] %s\n", + syslog(1, "REJECTED because of __ is internal only: %s = [%d] %s\n", u->url_key, StrLength(u->url_data), ChrPtr(u->url_data)); @@ -308,7 +318,7 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp, long keylen; #ifdef DEBUG_URLSTRINGS - lprintf(9, "\033[31mupload_handler() name=%s, type=%s, len=%d\033[0m\n", name, cbtype, length); + syslog(9, "upload_handler() name=%s, type=%s, len=%d", name, cbtype, length); #endif if (WCC->Hdr->urlstrings == NULL) WCC->Hdr->urlstrings = NewHash(1, NULL); @@ -325,7 +335,7 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp, Put(WCC->Hdr->urlstrings, u->url_key, keylen, u, free_url); } else { - lprintf(1, "REJECTED because of __ is internal only: %s = [%ld] %s\n", + syslog(1, "REJECTED because of __ is internal only: %s = [%d] %s\n", u->url_key, StrLength(u->url_data), ChrPtr(u->url_data)); @@ -333,7 +343,7 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp, free_url(u); } #ifdef DEBUG_URLSTRINGS - lprintf(9, "Key: <%s> len: [%ld] Data: <%s>\n", + syslog(9, "Key: <%s> len: [%d] Data: <%s>", u->url_key, StrLength(u->url_data), ChrPtr(u->url_data)); @@ -347,7 +357,7 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp, WCC->upload_filename = NewStrBufPlain(filename, -1); safestrncpy(WCC->upload_content_type, cbtype, sizeof(WC->upload_content_type)); #ifdef DEBUG_URLSTRINGS - lprintf(9, "File: <%s> len: [%ld]\n", filename, length); + syslog(9, "File: <%s> len: [%ld]", filename, length); #endif } @@ -361,7 +371,7 @@ void PutBstr(const char *key, long keylen, StrBuf *Value) urlcontent *u; if(keylen > sizeof(u->url_key)) { - lprintf(1, "URLkey to long! [%s]", key); + syslog(1, "invalid url_key"); FreeStrBuf(&Value); return; } @@ -419,16 +429,16 @@ void diagnostics(void) { output_headers(1, 1, 1, 0, 0, 0); wc_printf("Session: %d
\n", WC->wc_session); - wc_printf("Command:
\n");
+	wc_printf("Command: 
\n");
 /*	
-StrEscPuts(WC->UrlFragment1);
-	wc_printf("
\n"); - StrEscPuts(WC->UrlFragment2); - wc_printf("
\n"); - StrEscPuts(WC->UrlFragment3); +StrEscAppend(WC->WBuf, NULL, WC->UrlFragment1, 0, 0); + wc_printf("
\n"); +StrEscAppend(WC->WBuf, NULL, WC->UrlFragment12 0, 0); + wc_printf("
\n"); +StrEscAppend(WC->WBuf, NULL, WC->UrlFragment3, 0, 0); */ wc_printf("

\n"); - wc_printf("Variables:
\n");
+	wc_printf("Variables: 
\n");
 	dump_vars();
 	wc_printf("

\n"); wDumpContent(1);