aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorswhite <swhite@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2004-06-01 13:43:16 +0000
committerswhite <swhite@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2004-06-01 13:43:16 +0000
commitcacd8ef4102ec88f542da09acd44d0d0a0b28070 (patch)
treebe6593e7004eedc16ef87546b5f70ac709f0087d
parent6ed222ce2f447f20e04d2a448d4b2a0a723dc0ae (diff)
Concerning bug 1699:
Except for a few places where fprintf(stderr... is explicitly #ifdef'ed out as debug code, replaced calls with CCTK_WARN with appropriate warning levels. git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@210 1faa4e14-9dd3-4be0-9f0e-ffe519881164
-rw-r--r--src/Authorisation.c5
-rw-r--r--src/Content.c3
-rw-r--r--src/Parameters.c8
-rw-r--r--src/Server.c5
-rw-r--r--src/Sockets.c2
-rw-r--r--src/http.c13
6 files changed, 21 insertions, 15 deletions
diff --git a/src/Authorisation.c b/src/Authorisation.c
index 571118e..42529be 100644
--- a/src/Authorisation.c
+++ b/src/Authorisation.c
@@ -342,12 +342,13 @@ static int VerifyPassword(const char *database,
retcode = 1;
}
#else
- fprintf(stderr, "Sorry, crypt(3) not supported in this configuration.\n");
+ CCTK_WARN( 1, "Sorry, crypt(3) not supported in this configuration.\n" )
#endif
}
else
{
- fprintf(stderr, "Unknown encryption algorithm '%s'\n", data->encryption_scheme);
+ CCTK_WARN( 1, "Unknown encryption algorithm: " );
+ CCTK_WARN( 1, data->encryption_scheme );
}
}
}
diff --git a/src/Content.c b/src/Content.c
index cbb4279..77e6578 100644
--- a/src/Content.c
+++ b/src/Content.c
@@ -1030,7 +1030,8 @@ static int ControlSet(const cGH *cctkGH, httpRequest *request)
case 'R' : HTTP_SteerQueue(CCTK_THORNSTRING, "pause", "no");
break;
default :
- fprintf(stderr, "Unknown runstate '%s'\n", value);
+ CCTK_WARN(1, "Unknown runstate: \n\t" );
+ CCTK_WARN(1, value );
}
}
diff --git a/src/Parameters.c b/src/Parameters.c
index 55f0e98..f5150c4 100644
--- a/src/Parameters.c
+++ b/src/Parameters.c
@@ -312,9 +312,11 @@ static int ThornParameterPage(const cGH *cctkGH, httpRequest *request, void *dat
while((argument = HTTP_ArgumentWalk(request, first)) != NULL)
{
first = 0;
- fprintf(stderr, "Setting %s::%s to %s\n", thorn,
- HTTP_ArgName( argument),
- HTTP_ArgValue( argument ));
+ CCTK_WARN( 5, "Setting " );
+ CCTK_WARN( 5, thorn );
+ CCTK_WARN( 5, "::" );
+ CCTK_WARN( 5, HTTP_ArgName( argument) );
+ CCTK_WARN( 5, HTTP_ArgValue( argument ) );
HTTP_SteerQueue(thorn, HTTP_ArgName( argument),
HTTP_ArgValue( argument ));
}
diff --git a/src/Server.c b/src/Server.c
index 19ca3f5..ad44ba9 100644
--- a/src/Server.c
+++ b/src/Server.c
@@ -169,7 +169,8 @@ int HTTP_RegisterPage(const char *path, int (*function)(const cGH *, httpRequest
if(Util_HashData(pages, strlen(path), path, 0))
{
- fprintf(stderr, "Page %s already exists\n", path);
+ CCTK_WARN( 1, "Page already exists:\n" );
+ CCTK_WARN( 1, path );
}
else
{
@@ -533,7 +534,7 @@ static double evaluator(const char *expression, void *data)
retval = *((CCTK_REAL *)pointer);
break;
default :
- fprintf(stderr, "Unsupported variable type %d\n", vartype);
+ CCTK_WARN( 0, "Unsupported variable type" );
retval = 0.0;
}
}
diff --git a/src/Sockets.c b/src/Sockets.c
index 42b06d1..a029363 100644
--- a/src/Sockets.c
+++ b/src/Sockets.c
@@ -390,7 +390,7 @@ int HTTP_Write(httpRequest *request, const char *buffer, size_t count)
/* The socket is marked non-blocking and the requested operation would block. */
#endif
default :
- fprintf(stderr, "Error: this should never happen - %s %d", __FILE__, __LINE__);
+ CCTK_WARN (1, "Error: unknown errno ");
}
}
else
diff --git a/src/http.c b/src/http.c
index 36fcc5f..74b44fc 100644
--- a/src/http.c
+++ b/src/http.c
@@ -627,7 +627,8 @@ static int AddHeader(httpRequest *request, const char *line)
}
else
{
- fprintf(stderr, "Invalid header line '%s'\n", line);
+ CCTK_WARN( 1, "Invalid header line:\n" );
+ CCTK_WARN( 1, line );
}
if(value)
@@ -654,7 +655,7 @@ static int AddHeader(httpRequest *request, const char *line)
}
else
{
- fprintf(stderr, "Out of memory !\n");
+ CCTK_WARN( 0, "Out of memory!\n" );
}
}
else
@@ -773,14 +774,14 @@ static int StripArgs(httpRequest *request, char *request_uri)
}
else
{
-#ifdef HTTP_DEBUG
- fprintf(stderr, "Out of memory\n");
-#endif
+ CCTK_WARN( 0, "Out of memory!\n" );
}
}
else
{
- fprintf(stderr, "Argument '%s' has no value !\n", token);
+ CCTK_WARN( 1, "Argument " );
+ CCTK_WARN( 1, token );
+ CCTK_WARN( 1, " has no value!\n" );
}
token=strtok(NULL, "&");
}