]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - tools/cachemgr.cc
SourceFormat: enforcement
[thirdparty/squid.git] / tools / cachemgr.cc
index b9569cf50194fbe5bb5b0fb493e1088304908bf1..d36e9935c7e73c9b517417e9c5761f925beb3129 100644 (file)
 #include <sys/select.h>
 #endif
 #if HAVE_FNMATCH_H
-extern "C"
-{
+extern "C" {
 #include <fnmatch.h>
 }
 #endif
@@ -871,15 +870,17 @@ process_request(cachemgr_request * req)
                  req->hostname,
                  req->action,
                  make_auth_header(req));
-    if (write(s, buf, l) <0 )
+    if (write(s, buf, l) < 0) {
         debug(1) fprintf(stderr, "ERROR: (%d) writing request: '%s'\n", errno, buf);
-    else
+    } else {
         debug(1) fprintf(stderr, "wrote request: '%s'\n", buf);
+    }
     return read_reply(s, req);
 }
 
 int
-main(int argc, char *argv[]) {
+main(int argc, char *argv[])
+{
     char *s;
     cachemgr_request *req;
 
@@ -911,7 +912,8 @@ main(int argc, char *argv[]) {
 }
 
 static char *
-read_post_request(void) {
+read_post_request(void)
+{
     char *s;
     char *buf;
     int len;
@@ -939,7 +941,8 @@ read_post_request(void) {
 }
 
 static char *
-read_get_request(void) {
+read_get_request(void)
+{
     char *s;
 
     if ((s = getenv("QUERY_STRING")) == NULL)
@@ -949,7 +952,8 @@ read_get_request(void) {
 }
 
 static cachemgr_request *
-read_request(void) {
+read_request(void)
+{
     char *buf;
 
     cachemgr_request *req;
@@ -1028,7 +1032,8 @@ read_request(void) {
  * Currently no powerful encryption is used.
  */
 static void
-make_pub_auth(cachemgr_request * req) {
+make_pub_auth(cachemgr_request * req)
+{
     static char buf[1024];
     safe_free(req->pub_auth);
     debug(3) fprintf(stderr, "cmgr: encoding for pub...\n");
@@ -1051,7 +1056,8 @@ make_pub_auth(cachemgr_request * req) {
 }
 
 static void
-decode_pub_auth(cachemgr_request * req) {
+decode_pub_auth(cachemgr_request * req)
+{
     char *buf;
     const char *host_name;
     const char *time_str;
@@ -1109,13 +1115,15 @@ decode_pub_auth(cachemgr_request * req) {
 }
 
 static void
-reset_auth(cachemgr_request * req) {
+reset_auth(cachemgr_request * req)
+{
     safe_free(req->passwd);
     safe_free(req->pub_auth);
 }
 
 static const char *
-make_auth_header(const cachemgr_request * req) {
+make_auth_header(const cachemgr_request * req)
+{
     static char buf[1024];
     size_t stringLength = 0;
     const char *str64;
@@ -1140,7 +1148,8 @@ make_auth_header(const cachemgr_request * req) {
 }
 
 static int
-check_target_acl(const char *hostname, int port) {
+check_target_acl(const char *hostname, int port)
+{
     char config_line[BUFSIZ];
     FILE *fp = NULL;
     int ret = 0;