Skip to content

Commit

Permalink
Revised logging.
Browse files Browse the repository at this point in the history
Change-Id: Ie851d3f5866b96bfd43c86cac6bafd4a70273275
  • Loading branch information
stepheng-axis committed Feb 21, 2024
1 parent f35dcac commit dae9bc0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
15 changes: 0 additions & 15 deletions app/dockerdwrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,25 +877,12 @@ main(void)
return exit_code;
}

static const char *
str_rm(int method)
{
switch (method) {
case POST:
return "POST";
case DELETE:
return "DELETE";
}
return "UNKNOWN";
}

void
callback_action(__attribute__((unused)) fcgi_handle handle,
int request_method,
char *cert_name,
char *file_path)
{
syslog(LOG_INFO,"callback_action: request %s with cert_name %s, file_path %s", str_rm(request_method), cert_name, file_path);
// Check that the cert name is supported
bool supported_cert = false;
for (size_t i = 0; i < sizeof(tls_certs) / sizeof(tls_certs[0]); ++i) {
Expand Down Expand Up @@ -936,8 +923,6 @@ callback_action(__attribute__((unused)) fcgi_handle handle,
syslog(LOG_ERR, "Failed to remove %s from %s.", cert_name, tls_cert_path);
return;
}
} else {
syslog(LOG_INFO, "File %s: did not exist", cert_file_with_path);
}
break;

Expand Down
5 changes: 2 additions & 3 deletions app/fastcgi_cert_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ handle_http(void *data, __attribute__((unused)) void *userdata)
char *status = "200 OK";
char *return_message = "";
char *method = FCGX_GetParam("REQUEST_METHOD", request->envp);
syslog(LOG_INFO, "Entered handle_http: %s", method);
syslog(LOG_INFO,"cert_manager.cgi: %s", method);

if (strcmp(method, "POST") == 0 || strcmp(method, "DELETE") == 0) {
const char *uriString = FCGX_GetParam("REQUEST_URI", request->envp);
Expand Down Expand Up @@ -270,7 +270,7 @@ handle_http(void *data, __attribute__((unused)) void *userdata)
return_message = "The used request message is not allowed";
}

end:
end:
FCGX_FPrintF(request->out,
"Status: %s\r\n"
"Content-Type: text/html\r\n\r\n"
Expand All @@ -283,7 +283,6 @@ handle_http(void *data, __attribute__((unused)) void *userdata)
static void *
handle_fcgi(__attribute__((unused)) void *arg)
{
syslog(LOG_INFO, "Entered handle_fcgi");
GThreadPool *workers =
g_thread_pool_new((GFunc)handle_http, NULL, -1, FALSE, NULL);
while (workers) {
Expand Down

0 comments on commit dae9bc0

Please sign in to comment.