[Cherokee-commits] [3633] cherokee/branches/newerrors/cherokee: Converts the LOG_* in cherokee /source_interpreter.{c, h}.
SVN at cherokee-project.com
SVN at cherokee-project.com
Tue Sep 8 12:11:43 CEST 2009
Revision: 3633
http://svn.cherokee-project.com/changeset/3633
Author: alo
Date: 2009-09-08 12:11:43 +0200 (Tue, 08 Sep 2009)
Log Message:
-----------
Converts the LOG_* in cherokee/source_interpreter.{c,h}. It also
modifies cherokee/server.c so it passes the source priority number to
the configuration function.
Modified Paths:
--------------
cherokee/branches/newerrors/cherokee/error_list.py
cherokee/branches/newerrors/cherokee/server.c
cherokee/branches/newerrors/cherokee/source_interpreter.c
cherokee/branches/newerrors/cherokee/source_interpreter.h
Modified: cherokee/branches/newerrors/cherokee/error_list.py
===================================================================
--- cherokee/branches/newerrors/cherokee/error_list.py 2009-09-08 10:08:10 UTC (rev 3632)
+++ cherokee/branches/newerrors/cherokee/error_list.py 2009-09-08 10:11:43 UTC (rev 3633)
@@ -13,6 +13,29 @@
UNKNOWN_CAUSE = """We are not sure why this happened. (To-do)."""
+# cherokee/source_interpreter.c
+#
+e('SRC_INTER_NO_USER',
+ title = "User '%s' not found in the system",
+ desc = "The server is configured to execute an interpreter as a different user. However, it seems that the user does not exist in the system.",
+ admin = "/source/%d")
+
+e('SRC_INTER_NO_GROUP',
+ title = "Group '%s' not found in the system",
+ desc = "The server is configured to execute an interpreter as a different group. However, it seems that the group does not exist in the system.",
+ admin = "/source/%d")
+
+e('SRC_INTER_EMPTY_INTERPRETER',
+ title = "There is a 'Interpreter Source' witout an interpreter.",
+ desc = "The server configuration defines an 'interpreter' information source that does not specify an interpreter.",
+ admin = "/source/%d")
+
+e('SRC_INTER_NO_INTERPRETER',
+ title = "Could find interpreter '%s'",
+ desc = "The server configuration refers to an interpreter that is not installed in this system.",
+ admin = "/source/%d")
+
+
# cherokee/config_reader.c
#
e('CONF_READ_ACCESS_FILE',
Modified: cherokee/branches/newerrors/cherokee/server.c
===================================================================
--- cherokee/branches/newerrors/cherokee/server.c 2009-09-08 10:08:10 UTC (rev 3632)
+++ cherokee/branches/newerrors/cherokee/server.c 2009-09-08 10:11:43 UTC (rev 3633)
@@ -1158,7 +1158,7 @@
ret = cherokee_source_interpreter_new (&src2);
if (ret != ret_ok) return ret;
- ret = cherokee_source_interpreter_configure (src2, conf);
+ ret = cherokee_source_interpreter_configure (src2, conf, prio);
if (ret != ret_ok) return ret;
src = SOURCE(src2);
Modified: cherokee/branches/newerrors/cherokee/source_interpreter.c
===================================================================
--- cherokee/branches/newerrors/cherokee/source_interpreter.c 2009-09-08 10:08:10 UTC (rev 3632)
+++ cherokee/branches/newerrors/cherokee/source_interpreter.c 2009-09-08 10:11:43 UTC (rev 3633)
@@ -240,7 +240,6 @@
if (ret == ret_ok)
return ret_ok;
- LOG_ERROR ("Could not find interpreter '%s'\n", src->interpreter.buf);
return ret_error;
}
@@ -248,7 +247,9 @@
}
ret_t
-cherokee_source_interpreter_configure (cherokee_source_interpreter_t *src, cherokee_config_node_t *conf)
+cherokee_source_interpreter_configure (cherokee_source_interpreter_t *src,
+ cherokee_config_node_t *conf,
+ int prio)
{
ret_t ret;
cherokee_list_t *i, *j;
@@ -282,7 +283,7 @@
ret = cherokee_getpwnam (child->val.buf, &pwd, tmp, sizeof(tmp));
if ((ret != ret_ok) || (pwd.pw_dir == NULL)) {
- LOG_CRITICAL ("User '%s' not found in the system\n", child->val.buf);
+ LOG_CRITICAL (CHEROKEE_ERROR_SRC_INTER_NO_USER, child->val.buf, prio);
return ret_error;
}
@@ -298,7 +299,7 @@
ret = cherokee_getgrnam (child->val.buf, &grp, tmp, sizeof(tmp));
if (ret != ret_ok) {
- LOG_CRITICAL ("Group '%s' not found in the system\n", conf->val.buf);
+ LOG_CRITICAL (CHEROKEE_ERROR_SRC_INTER_NO_GROUP, conf->val.buf, prio);
return ret_error;
}
@@ -329,13 +330,13 @@
/* Sanity check
*/
if (cherokee_buffer_is_empty (&src->interpreter)) {
- LOG_CRITICAL_S ("'Source interpreter' with no interpreter\n");
+ LOG_CRITICAL (CHEROKEE_ERROR_SRC_INTER_EMPTY_INTERPRETER, prio);
return ret_error;
}
ret = check_interpreter (src);
if (ret != ret_ok) {
- LOG_ERROR ("Couldn't find interpreter '%s'\n", src->interpreter.buf);
+ LOG_ERROR (CHEROKEE_ERROR_SRC_INTER_NO_INTERPRETER, src->interpreter.buf, prio);
return ret_error;
}
Modified: cherokee/branches/newerrors/cherokee/source_interpreter.h
===================================================================
--- cherokee/branches/newerrors/cherokee/source_interpreter.h 2009-09-08 10:08:10 UTC (rev 3632)
+++ cherokee/branches/newerrors/cherokee/source_interpreter.h 2009-09-08 10:11:43 UTC (rev 3633)
@@ -63,12 +63,18 @@
ret_t cherokee_source_interpreter_new (cherokee_source_interpreter_t **src);
-ret_t cherokee_source_interpreter_configure (cherokee_source_interpreter_t *src, cherokee_config_node_t *conf);
-ret_t cherokee_source_interpreter_add_env (cherokee_source_interpreter_t *src, char *env, char *val);
-ret_t cherokee_source_interpreter_spawn (cherokee_source_interpreter_t *src,
- cherokee_logger_t *logger);
+ret_t cherokee_source_interpreter_configure (cherokee_source_interpreter_t *src,
+ cherokee_config_node_t *conf,
+ int prio);
+ret_t cherokee_source_interpreter_add_env (cherokee_source_interpreter_t *src,
+ char *env,
+ char *val);
+
+ret_t cherokee_source_interpreter_spawn (cherokee_source_interpreter_t *src,
+ cherokee_logger_t *logger);
+
ret_t cherokee_source_interpreter_connect_polling (cherokee_source_interpreter_t *src,
cherokee_socket_t *socket,
cherokee_connection_t *conn);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.octality.com/pipermail/cherokee-commits/attachments/20090908/fb6c562d/attachment.htm
More information about the Cherokee-commits
mailing list