summaryrefslogtreecommitdiffstats
path: root/nanohttp/nanohttp-url.c
diff options
context:
space:
mode:
authorGravatar m0gg2007-11-03 22:40:09 +0000
committerGravatar m0gg2007-11-03 22:40:09 +0000
commit8a6946b18003fae6400a137389f0cb13d0ac4bd6 (patch)
tree1fb0e6f58de5596f8dae00998da18472fb4952a1 /nanohttp/nanohttp-url.c
parentc1a7b2dabdc691139b744f0d4750f3b797b69073 (diff)
downloadcsoap-8a6946b18003fae6400a137389f0cb13d0ac4bd6.tar.gz
csoap-8a6946b18003fae6400a137389f0cb13d0ac4bd6.tar.bz2
Split nanoHTTP and cSOAP logging
Diffstat (limited to 'nanohttp/nanohttp-url.c')
-rw-r--r--nanohttp/nanohttp-url.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/nanohttp/nanohttp-url.c b/nanohttp/nanohttp-url.c
index 316fd27..8ba1619 100644
--- a/nanohttp/nanohttp-url.c
+++ b/nanohttp/nanohttp-url.c
@@ -1,5 +1,6 @@
+/** @file nanohttp-url.c URL parsing functions */
/******************************************************************
-* $Id: nanohttp-url.c,v 1.3 2006/12/16 16:09:45 m0gg Exp $
+* $Id: nanohttp-url.c,v 1.4 2007/11/03 22:40:15 m0gg Exp $
*
* CSOAP Project: A http client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -61,14 +62,14 @@ _hurl_dump(const struct hurl_t *url)
{
if (!url)
{
- log_error1("parameter url is NULL");
+ log_error("parameter url is NULL");
return;
}
- log_verbose2("PROTOCOL: %d", url->protocol);
- log_verbose2(" HOST: \"%s\"", url->host);
- log_verbose2(" PORT: %d", url->port);
- log_verbose2(" CONTEXT: \"%s\"", url->context);
+ log_verbose("PROTOCOL: %d", url->protocol);
+ log_verbose(" HOST: \"%s\"", url->host);
+ log_verbose(" PORT: %d", url->port);
+ log_verbose(" CONTEXT: \"%s\"", url->context);
return;
}
@@ -96,18 +97,18 @@ hurl_parse(struct hurl_t *url, const char *urlstr)
if (iprotocol == 0)
{
- log_error1("no protocol");
+ log_error("no protocol");
return herror_new("hurl_parse", URL_ERROR_NO_PROTOCOL, "No protocol");
}
if (iprotocol + 3 >= len)
{
- log_error1("no host");
+ log_error("no host");
return herror_new("hurl_parse", URL_ERROR_NO_HOST, "No host");
}
if (urlstr[iprotocol] != ':'
&& urlstr[iprotocol + 1] != '/' && urlstr[iprotocol + 2] != '/')
{
- log_error1("no protocol");
+ log_error("no protocol");
return herror_new("hurl_parse", URL_ERROR_NO_PROTOCOL, "No protocol");
}
@@ -121,7 +122,7 @@ hurl_parse(struct hurl_t *url, const char *urlstr)
if (ihost == iprotocol + 1)
{
- log_error1("no host");
+ log_error("no host");
return herror_new("hurl_parse", URL_ERROR_NO_HOST, "No host");
}
@@ -151,7 +152,7 @@ hurl_parse(struct hurl_t *url, const char *urlstr)
/* find right port */
if (!(entry = getservbyname(protocol, "tcp")))
{
- log_warn2("getservbyname(\"%s\", \"tcp\") returned NULL, please edit services database", protocol);
+ log_warn("getservbyname(\"%s\", \"tcp\") returned NULL, please edit services database", protocol);
switch (url->protocol)
{
@@ -171,7 +172,7 @@ hurl_parse(struct hurl_t *url, const char *urlstr)
size = ihost - iprotocol - 3;
if (!(url->host = (char *)malloc(size + 1)))
{
- log_error2("malloc failed (%s)", strerror(errno));
+ log_error("malloc failed (%s)", strerror(errno));
return herror_new("hurl_parse", URL_ERROR, "malloc failed (%s)", strerror(errno));
}
strncpy(url->host, &urlstr[iprotocol + 3], size);
@@ -191,7 +192,7 @@ hurl_parse(struct hurl_t *url, const char *urlstr)
size = len - iport;
if (!(url->context = (char *)malloc(size + 1)))
{
- log_error2("malloc failed (%s)", strerror(errno));
+ log_error("malloc failed (%s)", strerror(errno));
return herror_new("hurl_parse", URL_ERROR, "malloc failed (%s)", strerror(errno));
}
strncpy(url->context, &urlstr[iport], size);