]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1715567, r1715568, r1715570, r1715571, r1715572, r1715576, r1715581, r1715582...
authorJim Jagielski <jim@apache.org>
Tue, 29 Dec 2015 16:26:41 +0000 (16:26 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 29 Dec 2015 16:26:41 +0000 (16:26 +0000)
Remove some useless 'return' statements.

Remove some useless 'return' statements.

Remove some useless 'return' statements.

Remove some useless 'return' statements.

Remove some useless 'return' statements.
Add a blank line between functions.

Remove some useless 'return' statements.
Fix style and alignment.

Remove some useless 'return' statements.
Fix style.

Remove some useless 'return' statements.
Add a blank line between functions.

Remove some useless 'return' statements.

Remove some useless 'return' statements.

Remove some useless 'return' statements.
Submitted by: jailletc36
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1722180 13f79535-47bb-0310-9956-ffa450edef68

14 files changed:
STATUS
modules/aaa/mod_authn_socache.c
modules/cache/mod_socache_dbm.c
modules/dav/main/props.c
modules/filters/mod_filter.c
modules/filters/mod_include.c
modules/loggers/mod_logio.c
modules/mappers/mod_imagemap.c
modules/mappers/mod_negotiation.c
modules/metadata/mod_expires.c
modules/metadata/mod_usertrack.c
modules/proxy/mod_proxy_http.c
server/connection.c
server/mpm_common.c

diff --git a/STATUS b/STATUS
index 46f637e97e6ceb5d16b0ecff2259737f4c151190..398abe9069d44e7b3a03793e04a44ecbba477ca8 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -112,21 +112,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) Remove some useless return statements (+ some minor style changes)
-     trunk patch: http://svn.apache.org/r1715567
-                  http://svn.apache.org/r1715568
-                  http://svn.apache.org/r1715570
-                  http://svn.apache.org/r1715571
-                  http://svn.apache.org/r1715572
-                  http://svn.apache.org/r1715576
-                  http://svn.apache.org/r1715581
-                  http://svn.apache.org/r1715582
-                  http://svn.apache.org/r1715583
-                  http://svn.apache.org/r1715584
-                  http://svn.apache.org/r1715585
-     2.4.x patch: https://people.apache.org/~jailletc36/remove_return.patch
-     +1: jailletc36, jim, covener
-
   *) mod_ssl: Fix "warning: variable 'hssc' set but not used".
               2.4.x only, r1715255 merged in 2.4.18 missed this (trunk) hunk.
      2.4.x patch: http://people.apache.org/~ylavic/httpd-2.4.x-ssl_hssc_warning.patch
index 140f3b7dffbec4d979233210c7dd178f881b3251..d1a38ee7869832c032158c3a019d7c47a202e413 100644 (file)
@@ -57,6 +57,7 @@ static apr_status_t remove_lock(void *data)
     }
     return APR_SUCCESS;
 }
+
 static apr_status_t destroy_cache(void *data)
 {
     if (socache_instance) {
@@ -66,7 +67,6 @@ static apr_status_t destroy_cache(void *data)
     return APR_SUCCESS;
 }
 
-
 static int authn_cache_precfg(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptmp)
 {
     apr_status_t rv = ap_mutex_register(pconf, authn_cache_id,
@@ -82,6 +82,7 @@ static int authn_cache_precfg(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *p
     configured = 0;
     return OK;
 }
+
 static int authn_cache_post_config(apr_pool_t *pconf, apr_pool_t *plog,
                                    apr_pool_t *ptmp, server_rec *s)
 {
@@ -133,6 +134,7 @@ static int authn_cache_post_config(apr_pool_t *pconf, apr_pool_t *plog,
     apr_pool_cleanup_register(pconf, (void*)s, destroy_cache, apr_pool_cleanup_null);
     return OK;
 }
+
 static void authn_cache_child_init(apr_pool_t *p, server_rec *s)
 {
     const char *lock;
@@ -202,6 +204,7 @@ static void* authn_cache_dircfg_create(apr_pool_t *pool, char *s)
     ret->context = directory;
     return ret;
 }
+
 /* not sure we want this.  Might be safer to document use-all-or-none */
 static void* authn_cache_dircfg_merge(apr_pool_t *pool, void *BASE, void *ADD)
 {
@@ -286,6 +289,7 @@ static const char *construct_key(request_rec *r, const char *context,
         return apr_pstrcat(r->pool, context, ":", user, ":", realm, NULL);
     }
 }
+
 static void ap_authn_cache_store(request_rec *r, const char *module,
                                  const char *user, const char *realm,
                                  const char* data)
@@ -352,14 +356,12 @@ static void ap_authn_cache_store(request_rec *r, const char *module,
     if (rv != APR_SUCCESS) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01683) "Failed to release mutex!");
     }
-    return;
 }
 
 #define MAX_VAL_LEN 100
 static authn_status check_password(request_rec *r, const char *user,
                                    const char *password)
 {
-
     /* construct key
      * look it up
      * if found, test password
@@ -457,6 +459,7 @@ static const authn_provider authn_cache_provider =
     &check_password,
     &get_realm_hash,
 };
+
 static void register_hooks(apr_pool_t *p)
 {
     ap_register_auth_provider(p, AUTHN_PROVIDER_GROUP, "socache",
index 1ffc60077176fe0d775193cd74f18bd46b1eda3d..579d2ffecdfc3337539ceb8fff42b224431f9d60 100644 (file)
@@ -184,8 +184,6 @@ static void socache_dbm_destroy(ap_socache_instance_t *ctx, server_rec *s)
     unlink(apr_pstrcat(ctx->pool, ctx->data_file, ".pag", NULL));
     unlink(apr_pstrcat(ctx->pool, ctx->data_file, ".db", NULL));
     unlink(ctx->data_file);
-
-    return;
 }
 
 static apr_status_t socache_dbm_store(ap_socache_instance_t *ctx,
@@ -510,7 +508,6 @@ static void socache_dbm_status(ap_socache_instance_t *ctx, request_rec *r,
         ap_rprintf(r, "CacheCurrentSize: %ld\n", size);
         ap_rprintf(r, "CacheAvgEntrySize: %d\n", avg);
     }
-    return;
 }
 
 static apr_status_t socache_dbm_iterate(ap_socache_instance_t *ctx,
index 0fa99f03893929094c52ed349d9f3197af6b2fda..f64878e67fe2710f22ce3271b322a45a974ff224 100644 (file)
@@ -566,7 +566,6 @@ DAV_DECLARE(void) dav_close_propdb(dav_propdb *propdb)
 #if 0
     apr_pool_destroy(propdb->p);
 #endif
-    return;
 }
 
 DAV_DECLARE(dav_get_props_result) dav_get_allprops(dav_propdb *propdb,
index d3a8b2be3b7f5170590213d325dc84a5b056fd94..7b692233ee007e38f2559de41dba91c8bd843729 100644 (file)
@@ -670,8 +670,6 @@ static void filter_insert(request_rec *r)
         }
 #endif
     }
-
-    return;
 }
 
 static void filter_hooks(apr_pool_t *pool)
index 843da952ef7ca35396b844d6c5413322ee5d3564..557096a57101b5fe2f8198747acf7ff8ab29e1c7 100644 (file)
@@ -347,8 +347,6 @@ static void debug_dump_tree(include_ctx_t *ctx, parse_node_t *root)
     if (root->right) root->right->dump_done = 0;
 
     debug_printf(ctx, "     --- End Parse Tree ---\n\n");
-
-    return;
 }
 
 #define DEBUG_INIT(ctx, filter, brigade) do { \
@@ -1676,8 +1674,6 @@ static void ap_ssi_get_tag_and_value(include_ctx_t *ctx, char **tag,
     if (dodecode && *tag_val) {
         decodehtml(*tag_val);
     }
-
-    return;
 }
 
 static int find_file(request_rec *r, const char *directive, const char *tag,
index 58aa92cf051f0f7df0790ff8dcf3f6214b9da98c..6d61d2e5d40320050780eeec5ea94352b6a31892 100644 (file)
@@ -228,7 +228,6 @@ static void logio_insert_filter(request_rec * r)
     if (conf->track_ttfb) { 
         ap_add_output_filter(logio_ttfb_filter_name, NULL, r, r->connection);
     }
-    return;
 }
 
 static const char *logio_track_ttfb(cmd_parms *cmd, void *in_dir_config, int arg)
index 65b9eb15d2aaa4874e7b7567c65767356cb4dae5..187a500a5d2256f8f4901d51c70cf137729cb8d4 100644 (file)
@@ -486,8 +486,6 @@ static void menu_header(request_rec *r, char *menu)
                   ap_escape_html(r->pool, r->uri),
                   "</h1>\n<hr />\n\n", NULL);
     }
-
-    return;
 }
 
 static void menu_blank(request_rec *r, char *menu)
@@ -501,11 +499,11 @@ static void menu_blank(request_rec *r, char *menu)
     else if (!strcasecmp(menu, "unformatted")) {
         ap_rputs("\n", r);
     }
-    return;
 }
 
 static void menu_comment(request_rec *r, char *menu, char *comment)
 {
+    /* comments are ignored in the 'formatted' form */
     if (!strcasecmp(menu, "formatted")) {
         ap_rputs("\n", r);         /* print just a newline if 'formatted' */
     }
@@ -515,8 +513,6 @@ static void menu_comment(request_rec *r, char *menu, char *comment)
     else if (!strcasecmp(menu, "unformatted") && *comment) {
         ap_rvputs(r, comment, "\n", NULL);
     }
-    return;                     /* comments are ignored in the
-                                   'formatted' form */
 }
 
 static void menu_default(request_rec *r, const char *menu, const char *href, const char *text)
@@ -541,7 +537,6 @@ static void menu_default(request_rec *r, const char *menu, const char *href, con
     else if (!strcasecmp(menu, "unformatted")) {
         ap_rvputs(r, "<a href=\"", ehref, "\">", etext, "</a>", NULL);
     }
-    return;
 }
 
 static void menu_directive(request_rec *r, const char *menu, const char *href, const char *text)
@@ -566,7 +561,6 @@ static void menu_directive(request_rec *r, const char *menu, const char *href, c
     else if (!strcasecmp(menu, "unformatted")) {
         ap_rvputs(r, "<a href=\"", ehref, "\">", etext, "</a>", NULL);
     }
-    return;
 }
 
 static void menu_footer(request_rec *r)
index 77f27cc6bd8960836cf9b65af4b92af98e5788fa..891456e9339fd22788e7c62bb1792f9a3803e233 100644 (file)
@@ -791,8 +791,9 @@ static enum header_state get_header_line(char *buffer, int len, apr_file_t *map)
              */
 
             while (c != '\n' && apr_isspace(c)) {
-                if(apr_file_getc(&c, map) != APR_SUCCESS)
+                if (apr_file_getc(&c, map) != APR_SUCCESS) {
                     break;
+                }
             }
 
             apr_file_ungetc(c, map);
@@ -1058,10 +1059,9 @@ static int read_type_map(apr_file_t **map, negotiation_state *neg,
     return OK;
 }
 
-
 /* Sort function used by read_types_multi. */
-static int variantsortf(var_rec *a, var_rec *b) {
-
+static int variantsortf(var_rec *a, var_rec *b)
+{
     /* First key is the source quality, sort in descending order. */
 
     /* XXX: note that we currently implement no method of setting the
@@ -1727,7 +1727,6 @@ static void set_language_quality(negotiation_state *neg, var_rec *variant)
             }
         }
     }
-    return;
 }
 
 /* Determining the content length --- if the map didn't tell us,
@@ -2967,8 +2966,9 @@ static int handle_map_file(request_rec *r)
     char *udir;
     const char *new_req;
 
-    if(strcmp(r->handler,MAP_FILE_MAGIC_TYPE) && strcmp(r->handler,"type-map"))
+    if (strcmp(r->handler, MAP_FILE_MAGIC_TYPE) && strcmp(r->handler, "type-map")) {
         return DECLINED;
+    }
 
     neg = parse_accept_headers(r);
     if ((res = read_type_map(&map, neg, r))) {
@@ -2976,7 +2976,9 @@ static int handle_map_file(request_rec *r)
     }
 
     res = do_negotiation(r, neg, &best, 0);
-    if (res != 0) return res;
+    if (res != 0) {
+        return res;
+    }
 
     if (best->body)
     {
index 8f8a7776939c73ea331b3e9f2d7bd6369f4eeebd..447fce48df669ce16b87145d8afbeeb80cb586d6 100644 (file)
@@ -546,8 +546,8 @@ static void expires_insert_filter(request_rec *r)
         return;
     }
     ap_add_output_filter("MOD_EXPIRES", NULL, r, r->connection);
-    return;
 }
+
 static void register_hooks(apr_pool_t *p)
 {
     /* mod_expires needs to run *before* the cache save filter which is
index 377c77bc45f78d70d3529d2f8b0fb4ab5e1725bf..73a9f45cc6100efd3794db8eb7e6bfca0221dc11 100644 (file)
@@ -148,7 +148,6 @@ static void make_cookie(request_rec *r)
                    (dcfg->style == CT_COOKIE2 ? "Set-Cookie2" : "Set-Cookie"),
                    new_cookie);
     apr_table_setn(r->notes, "cookie", apr_pstrdup(r->pool, cookiebuf));   /* log first time */
-    return;
 }
 
 /* dcfg->regexp is "^cookie_name=([^;]+)|;[ \t]+cookie_name=([^;]+)",
index 5e95ea2fa0e5192ad3d2f296034244781169588b..3a012cc4b59e9b187f35a627d24ed968ac4ff117 100644 (file)
@@ -1061,7 +1061,6 @@ static void process_proxy_header(request_rec *r, proxy_dir_conf *c,
        }
     }
     apr_table_add(r->headers_out, key, value);
-    return;
 }
 
 /*
@@ -1132,10 +1131,11 @@ static void ap_proxy_read_headers(request_rec *r, request_rec *rr,
                                       r->uri, r->method);
                         *pread_len = len;
                         return;
-                    } else {
-                         ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01099)
-                                       "No HTTP headers returned by %s (%s)",
-                                       r->uri, r->method);
+                    }
+                    else {
+                        ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01099)
+                                      "No HTTP headers returned by %s (%s)",
+                                      r->uri, r->method);
                         return;
                     }
                 }
index 4f862e4ece611b7ebb2263897b5f01a7756e3548..44a6dbe49aed6349904c40c3659a5bef34fe73a5 100644 (file)
@@ -196,7 +196,6 @@ AP_DECLARE(void) ap_lingering_close(conn_rec *c)
     } while (now < timeup);
 
     apr_socket_close(csd);
-    return;
 }
 
 AP_CORE_DECLARE(void) ap_process_connection(conn_rec *c, void *csd)
index e7121a772cdd3c0e1f798392e62665240b10c4ee..3ea43e7922653c00f2a589da957e522bd8b0ff67 100644 (file)
@@ -198,7 +198,6 @@ AP_DECLARE(void) ap_wait_or_timeout(apr_exit_why_e *status, int *exitcode,
 
     apr_sleep(apr_time_from_sec(1));
     ret->pid = -1;
-    return;
 }
 
 #if defined(TCP_NODELAY)