/*
* parse urlparts and post data
*
- * Copyright (c) 1996-2011 by the citadel.org team
+ * 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 as
- * published by the Free Software Foundation; either version 3 of the
- * License, or (at your option) any later version.
+ * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "webcit.h"
}
keylen = aptr - up - 1; /* -1 -> '=' */
if(keylen > sizeof(u->url_key)) {
- syslog(1, "URLkey to long! [%s]", up);
- continue;
+ syslog(LOG_WARNING, "invalid url_key");
+ return;
}
u = (urlcontent *) malloc(sizeof(urlcontent));
memcpy(u->url_key, up, keylen);
u->url_key[keylen] = '\0';
if (keylen < 0) {
- syslog(1, "URLkey to long! [%s]", up);
+ syslog(LOG_WARNING, "invalid url_key");
free(u);
- continue;
+ return;
}
if (strncmp(u->url_key, "__", 2) != 0)
u->url_data = NewStrBufPlain(aptr, len);
StrBufUnescape(u->url_data, 1);
#ifdef DEBUG_URLSTRINGS
- syslog(9, "%s = [%d] %s\n",
+ syslog(LOG_DEBUG, "%s = [%d] %s\n",
u->url_key,
StrLength(u->url_data),
ChrPtr(u->url_data));
len = bptr - aptr;
u->url_data = NewStrBufPlain(aptr, len);
StrBufUnescape(u->url_data, 1);
- syslog(1, "REJECTED because of __ is internal only: %s = [%d] %s\n",
+ syslog(LOG_WARNING, "REJECTED because of __ is internal only: %s = [%d] %s\n",
u->url_key,
StrLength(u->url_data),
ChrPtr(u->url_data));
long keylen;
#ifdef DEBUG_URLSTRINGS
- syslog(9, "upload_handler() name=%s, type=%s, len=%d", name, cbtype, length);
+ syslog(LOG_DEBUG, "upload_handler() name=%s, type=%s, len=%d", name, cbtype, length);
#endif
if (WCC->Hdr->urlstrings == NULL)
WCC->Hdr->urlstrings = NewHash(1, NULL);
Put(WCC->Hdr->urlstrings, u->url_key, keylen, u, free_url);
}
else {
- syslog(1, "REJECTED because of __ is internal only: %s = [%d] %s\n",
+ syslog(LOG_INFO, "REJECTED because of __ is internal only: %s = [%d] %s\n",
u->url_key,
StrLength(u->url_data),
ChrPtr(u->url_data));
free_url(u);
}
#ifdef DEBUG_URLSTRINGS
- syslog(9, "Key: <%s> len: [%d] Data: <%s>",
+ syslog(LOG_DEBUG, "Key: <%s> len: [%d] Data: <%s>",
u->url_key,
StrLength(u->url_data),
ChrPtr(u->url_data));
WCC->upload_filename = NewStrBufPlain(filename, -1);
safestrncpy(WCC->upload_content_type, cbtype, sizeof(WC->upload_content_type));
#ifdef DEBUG_URLSTRINGS
- syslog(9, "File: <%s> len: [%ld]", filename, length);
+ syslog(LOG_DEBUG, "File: <%s> len: [%ld]", filename, length);
#endif
}
urlcontent *u;
if(keylen > sizeof(u->url_key)) {
- syslog(1, "URLkey to long! [%s]", key);
+ syslog(LOG_WARNING, "invalid url_key");
FreeStrBuf(&Value);
return;
}