diff options
author | m0gg | 2006-12-19 08:55:17 +0000 |
---|---|---|
committer | m0gg | 2006-12-19 08:55:17 +0000 |
commit | 2fbfdcdff09db6a1c0041022b208320d15e24d13 (patch) | |
tree | 554da23ed4ef5818669b40614b792e3b09271423 | |
parent | b726c779ca481e1890c0abcb0f7f5947001b2e1e (diff) | |
download | csoap-2fbfdcdff09db6a1c0041022b208320d15e24d13.tar.gz csoap-2fbfdcdff09db6a1c0041022b208320d15e24d13.tar.bz2 |
Adjust wording according to WS Management: Service Life Cycle
-rw-r--r-- | nanohttp/nanohttp-admin.c | 24 | ||||
-rw-r--r-- | nanohttp/nanohttp-admin.h | 10 | ||||
-rw-r--r-- | nanohttp/nanohttp-server.c | 10 | ||||
-rw-r--r-- | nanohttp/nanohttp-server.h | 8 |
4 files changed, 27 insertions, 25 deletions
diff --git a/nanohttp/nanohttp-admin.c b/nanohttp/nanohttp-admin.c index b84c4d6..c06577b 100644 --- a/nanohttp/nanohttp-admin.c +++ b/nanohttp/nanohttp-admin.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: nanohttp-admin.c,v 1.9 2006/12/16 17:38:19 m0gg Exp $ +* $Id: nanohttp-admin.c,v 1.10 2006/12/19 08:55:17 m0gg Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -91,12 +91,12 @@ _httpd_admin_list_services(httpd_conn_t *conn) { switch (node->status) { - case NHTTPD_SERVICE_DISABLED: - sprintf(buffer, "<li><a href=\"%s\">%s</a> <a href=\"?" NHTTPD_ADMIN_QUERY_ENABLE_SERVICE "=%s\">[Enable]</a> <a href=\"?" NHTTPD_ADMIN_QUERY_STATISTICS "=%s\">[Statistics]</a></li>", node->ctx, node->ctx, node->ctx, node->ctx); + case NHTTPD_SERVICE_DOWN: + sprintf(buffer, "<li><a href=\"%s\">%s</a> <a href=\"?" NHTTPD_ADMIN_QUERY_ACTIVATE_SERVICE "=%s\">[Activate]</a> <a href=\"?" NHTTPD_ADMIN_QUERY_STATISTICS "=%s\">[Statistics]</a></li>", node->ctx, node->ctx, node->ctx, node->ctx); break; - case NHTTPD_SERVICE_ENABLED: + case NHTTPD_SERVICE_UP: default: - sprintf(buffer, "<li><a href=\"%s\">%s</a> <a href=\"?" NHTTPD_ADMIN_QUERY_DISABLE_SERVICE "=%s\">[Disable]</a> <a href=\"?" NHTTPD_ADMIN_QUERY_STATISTICS "=%s\">[Statistics]</a></li>", node->ctx, node->ctx, node->ctx, node->ctx); + sprintf(buffer, "<li><a href=\"%s\">%s</a> <a href=\"?" NHTTPD_ADMIN_QUERY_PASSIVATE_SERVICE "=%s\">[Passivate]</a> <a href=\"?" NHTTPD_ADMIN_QUERY_STATISTICS "=%s\">[Statistics]</a></li>", node->ctx, node->ctx, node->ctx, node->ctx); break; } http_output_stream_write_string(conn->out, buffer); @@ -154,7 +154,7 @@ _httpd_admin_enable_service(httpd_conn_t *conn, const char *service_name) hservice_t *service; char buffer[1024]; - sprintf(buffer, "Enabling service <b>%s</b>", service_name); + sprintf(buffer, "Activating service <b>%s</b>", service_name); _httpd_admin_send_title(conn, buffer); if (!(service = httpd_find_service(service_name))) @@ -172,7 +172,7 @@ _httpd_admin_enable_service(httpd_conn_t *conn, const char *service_name) http_output_stream_write_string(conn->out, "<p>" - "Service enabled" + "Service is up" "</p>"); _httpd_admin_send_footer(conn); @@ -186,7 +186,7 @@ _httpd_admin_disable_service(httpd_conn_t *conn, const char *service_name) hservice_t *service; char buffer[1024]; - sprintf(buffer, "Disabling service <b>%s</b>", service_name); + sprintf(buffer, "Passivating service <b>%s</b>", service_name); _httpd_admin_send_title(conn, buffer); if (!(service = httpd_find_service(service_name))) @@ -203,7 +203,7 @@ _httpd_admin_disable_service(httpd_conn_t *conn, const char *service_name) http_output_stream_write_string(conn->out, "<p>" - "Service disabled" + "Service is down" "</p>"); _httpd_admin_send_footer(conn); @@ -223,11 +223,11 @@ _httpd_admin_handle_get(httpd_conn_t * conn, struct hrequest_t *req) { _httpd_admin_list_statistics(conn, param); } - else if ((param = hpairnode_get_ignore_case(req->query, NHTTPD_ADMIN_QUERY_ENABLE_SERVICE))) + else if ((param = hpairnode_get_ignore_case(req->query, NHTTPD_ADMIN_QUERY_ACTIVATE_SERVICE))) { _httpd_admin_enable_service(conn, param); } - else if ((param = hpairnode_get_ignore_case(req->query, NHTTPD_ADMIN_QUERY_DISABLE_SERVICE))) + else if ((param = hpairnode_get_ignore_case(req->query, NHTTPD_ADMIN_QUERY_PASSIVATE_SERVICE))) { _httpd_admin_disable_service(conn, param); } @@ -260,7 +260,7 @@ _httpd_admin_entry(httpd_conn_t * conn, struct hrequest_t *req) } else { - httpd_send_header(conn, 200, HTTP_STATUS_200_REASON_PHRASE); + httpd_send_header(conn, 501, HTTP_STATUS_501_REASON_PHRASE); http_output_stream_write_string(conn->out, "<html>" "<head>" diff --git a/nanohttp/nanohttp-admin.h b/nanohttp/nanohttp-admin.h index 05ce5cf..bbbc0e2 100644 --- a/nanohttp/nanohttp-admin.h +++ b/nanohttp/nanohttp-admin.h @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: nanohttp-admin.h,v 1.5 2006/12/10 19:21:06 m0gg Exp $ + * $Id: nanohttp-admin.h,v 1.6 2006/12/19 08:55:17 m0gg Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -83,11 +83,11 @@ * Example query: * * @code - * http://localhost:10000/nhttp?enable=SERVICE_CONTEXT + * http://localhost:10000/nhttp?activate=SERVICE_CONTEXT * @endcode * */ -#define NHTTPD_ADMIN_QUERY_ENABLE_SERVICE "enable" +#define NHTTPD_ADMIN_QUERY_ACTIVATE_SERVICE "activate" /** * @@ -96,11 +96,11 @@ * Example query: * * @code - * http://localhost:10000/nhttp?disable=SERVICE_CONTEXT + * http://localhost:10000/nhttp?passivate=SERVICE_CONTEXT * @endcode * */ -#define NHTTPD_ADMIN_QUERY_DISABLE_SERVICE "disable" +#define NHTTPD_ADMIN_QUERY_PASSIVATE_SERVICE "passivate" #ifdef __cplusplus extern "C" { diff --git a/nanohttp/nanohttp-server.c b/nanohttp/nanohttp-server.c index d9db9b1..078eb76 100644 --- a/nanohttp/nanohttp-server.c +++ b/nanohttp/nanohttp-server.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: nanohttp-server.c,v 1.76 2006/12/16 17:30:36 m0gg Exp $ +* $Id: nanohttp-server.c,v 1.77 2006/12/19 08:55:17 m0gg Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -327,7 +327,7 @@ httpd_register_secure(const char *ctx, httpd_service func, httpd_auth auth) service->next = NULL; service->auth = auth; service->func = func; - service->status = NHTTPD_SERVICE_ENABLED; + service->status = NHTTPD_SERVICE_UP; strcpy(service->ctx, ctx); log_verbose3("register service (%p) for \"%s\"", service, SAVE_STR(ctx)); @@ -434,7 +434,7 @@ int httpd_enable_service(hservice_t *service) int ret; ret = service->status; - service->status = NHTTPD_SERVICE_ENABLED; + service->status = NHTTPD_SERVICE_UP; return ret; } @@ -444,7 +444,7 @@ int httpd_disable_service(hservice_t *service) int ret; ret = service->status; - service->status = NHTTPD_SERVICE_DISABLED; + service->status = NHTTPD_SERVICE_DOWN; return ret; } @@ -741,7 +741,7 @@ httpd_session_main(void *data) { log_verbose3("service '%s' for '%s' found", service->ctx, req->path); - if (service->status == NHTTPD_SERVICE_ENABLED) + if (service->status == NHTTPD_SERVICE_UP) { pthread_rwlock_wrlock(&(service->statistics->lock)); service->statistics->requests++; diff --git a/nanohttp/nanohttp-server.h b/nanohttp/nanohttp-server.h index 3b70dd7..7491722 100644 --- a/nanohttp/nanohttp-server.h +++ b/nanohttp/nanohttp-server.h @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: nanohttp-server.h,v 1.32 2006/12/12 07:23:11 m0gg Exp $ + * $Id: nanohttp-server.h,v 1.33 2006/12/19 08:55:17 m0gg Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -241,16 +241,18 @@ struct service_statistics /** * * @see hservice_t + * @see http://www.w3.org/TR/wslc/ * */ -#define NHTTPD_SERVICE_DISABLED 0 +#define NHTTPD_SERVICE_DOWN 0 /** * * @see hservice_t + * @see http://www.w3.org/TR/wslc/ * */ -#define NHTTPD_SERVICE_ENABLED 1 +#define NHTTPD_SERVICE_UP 1 /** * |