]> granicus.if.org Git - apache/commitdiff
Merge r1533765, r1621419, r1638159, r1638188, r1601603, r1638412, r1418763 from trunk
authorChristophe Jaillet <jailletc36@apache.org>
Sat, 29 Nov 2014 09:22:43 +0000 (09:22 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Sat, 29 Nov 2014 09:22:43 +0000 (09:22 +0000)
    ssl: Axe needless string duplication in setup for call to apr_proc_create()
    Fix sscanf format spotted by cppcheck
    fix indent.
    fix style
    Private function doesn't need ap_ prefix.
    tab vs space
    rename variables: s should be the server_rec

Submitted by: trawick, jailletc36, jailletc36, jailletc36, takashi, jailletc36, sf
Reviewed by: jailletc36, ylavic, covener
Backported by: jailletc36

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

STATUS
modules/dav/fs/repos.c
modules/loggers/mod_logio.c
modules/proxy/mod_proxy_wstunnel.c
modules/proxy/proxy_util.c
modules/ssl/ssl_engine_init.c
modules/ssl/ssl_engine_io.c
modules/ssl/ssl_engine_pphrase.c
server/protocol.c

diff --git a/STATUS b/STATUS
index 62533dfb02cb3dd88ae9a5fa5007df172f71f64b..766389a1d503c7ccb65f2ebd4bf3d91a899ec06a 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -110,24 +110,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      2.4.x patch: trunk works
      +1 jkaluza, ylavic, covener
 
-   * easy proposals to synch 2.4.x and trunk
-        - ssl: Axe needless string duplication in setup for call to apr_proc_create()
-        - Fix sscanf format spotted by cppcheck
-        - fix indent.
-        - fix style
-        - Private function doesn't need ap_ prefix.
-        - tab vs space
-        - rename variables: s should be the server_rec
-     trunk patch: http://svn.apache.org/r1533765
-                  http://svn.apache.org/r1621419
-                  http://svn.apache.org/r1638159
-                  http://svn.apache.org/r1638188
-                  http://svn.apache.org/r1601603
-                  http://svn.apache.org/r1638412
-                  http://svn.apache.org/r1418763
-     2.4.x patch: trunk works
-                  http://people.apache.org/~jailletc36/backport10.patch
-     +1: jailletc36, ylavic, covener
 
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
index 6c4c44b1fdef8a3088f6e8b38d5193767dbcb0c7..950646eed84fd7e20b384930e01fd4e4ee89b63e 100644 (file)
@@ -874,12 +874,13 @@ static int dav_fs_is_parent_resource(
             && ctx2->pathname[len1] == '/');
 }
 
-static apr_status_t tmpfile_cleanup(void *data) {
-        dav_stream *ds = data;
-        if (ds->temppath) {
-                apr_file_remove(ds->temppath, ds->p);
-        }
-        return APR_SUCCESS;
+static apr_status_t tmpfile_cleanup(void *data)
+{
+    dav_stream *ds = data;
+    if (ds->temppath) {
+        apr_file_remove(ds->temppath, ds->p);
+    }
+    return APR_SUCCESS;
 }
 
 /* custom mktemp that creates the file with APR_OS_DEFAULT permissions */
index ad387a9b1b64ab6fee4f947e788bf190484bffc5..359d467359359ea7fb53d5d5993ee8a873eb9c77 100644 (file)
@@ -52,7 +52,8 @@ typedef struct logio_config_t {
  * Optional function for the core to add to bytes_out
  */
 
-static void ap_logio_add_bytes_out(conn_rec *c, apr_off_t bytes){
+static void ap_logio_add_bytes_out(conn_rec *c, apr_off_t bytes)
+{
     logio_config_t *cf = ap_get_module_config(c->conn_config, &logio_module);
 
     cf->bytes_out += bytes;
@@ -62,7 +63,8 @@ static void ap_logio_add_bytes_out(conn_rec *c, apr_off_t bytes){
  * Optional function for modules to adjust bytes_in
  */
 
-static void ap_logio_add_bytes_in(conn_rec *c, apr_off_t bytes){
+static void ap_logio_add_bytes_in(conn_rec *c, apr_off_t bytes)
+{
     logio_config_t *cf = ap_get_module_config(c->conn_config, &logio_module);
 
     cf->bytes_in += bytes;
@@ -132,7 +134,8 @@ static apr_status_t logio_in_filter(ap_filter_t *f,
                                     apr_bucket_brigade *bb,
                                     ap_input_mode_t mode,
                                     apr_read_type_e block,
-                                    apr_off_t readbytes) {
+                                    apr_off_t readbytes)
+{
     apr_off_t length;
     apr_status_t status;
     logio_config_t *cf = ap_get_module_config(f->c->conn_config, &logio_module);
@@ -151,7 +154,8 @@ static apr_status_t logio_in_filter(ap_filter_t *f,
  * The hooks...
  */
 
-static int logio_pre_conn(conn_rec *c, void *csd) {
+static int logio_pre_conn(conn_rec *c, void *csd)
+{
     logio_config_t *cf = apr_pcalloc(c->pool, sizeof(*cf));
 
     ap_set_module_config(c->conn_config, &logio_module, cf);
index 6013549ac66d6f2f0fb8f3caba682a49dea0a05a..5fb8eb66e8e6204a1ca8db12017e2ed217a36a9f 100644 (file)
@@ -144,7 +144,7 @@ static int proxy_wstunnel_transfer(request_rec *r, conn_rec *c_i, conn_rec *c_o,
 /*
  * process the request and write the response.
  */
-static int ap_proxy_wstunnel_request(apr_pool_t *p, request_rec *r,
+static int proxy_wstunnel_request(apr_pool_t *p, request_rec *r,
                                 proxy_conn_rec *conn,
                                 proxy_worker *worker,
                                 proxy_server_conf *conf,
@@ -371,7 +371,7 @@ static int proxy_wstunnel_handler(request_rec *r, proxy_worker *worker,
 
 
         /* Step Three: Process the Request */
-        status = ap_proxy_wstunnel_request(p, r, backend, worker, conf, uri, locurl,
+        status = proxy_wstunnel_request(p, r, backend, worker, conf, uri, locurl,
                                       server_portstr);
         break;
     }
index e0fb69b42ae6f65937f5719251986d8d906553f3..060b98f866455f29347fd15995cf4e32ac70bbb8 100644 (file)
@@ -2527,7 +2527,7 @@ static apr_status_t send_http_connect(proxy_conn_rec *backend,
 
     /* Check for HTTP_OK response status */
     if (status == APR_SUCCESS) {
-        int major, minor;
+        unsigned int major, minor;
         /* Only scan for three character status code */
         char code_str[4];
 
@@ -2545,7 +2545,7 @@ static apr_status_t send_http_connect(proxy_conn_rec *backend,
                 ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(00950)
                              "send_http_connect: the forward proxy returned code is '%s'",
                              code_str);
-            status = APR_INCOMPLETE;
+                status = APR_INCOMPLETE;
             }
         }
     }
@@ -3435,7 +3435,7 @@ PROXY_DECLARE(int) ap_proxy_create_hdrbrgd(apr_pool_t *p,
 
         /* for sub-requests, ignore freshness/expiry headers */
         if (r->main) {
-            if (    !strcasecmp(headers_in[counter].key, "If-Match")
+            if (   !strcasecmp(headers_in[counter].key, "If-Match")
                 || !strcasecmp(headers_in[counter].key, "If-Modified-Since")
                 || !strcasecmp(headers_in[counter].key, "If-Range")
                 || !strcasecmp(headers_in[counter].key, "If-Unmodified-Since")
index 6648f7c2df164df3590dd2b35bf55d5c72e70810..772c8d3f4b197aa4219771ad6a4fff23d7db5e2c 100644 (file)
@@ -1039,7 +1039,7 @@ static apr_status_t ssl_init_server_certs(server_rec *s,
         if (!(cert = SSL_CTX_get0_certificate(mctx->ssl_ctx))) {
 #else
         ssl = SSL_new(mctx->ssl_ctx);
-       if (ssl) {
+        if (ssl) {
             /* Workaround bug in SSL_get_certificate in OpenSSL 0.9.8y */
             SSL_set_connect_state(ssl);
             cert = SSL_get_certificate(ssl);
index 1422f2aeaffd7164025bd9fcc52cd83804eb59b7..fc0f36a74c010f0da8d564c1c258ddc5f826d5d4 100644 (file)
@@ -1954,8 +1954,8 @@ void ssl_io_filter_register(apr_pool_t *p)
 
 #define DUMP_WIDTH 16
 
-static void ssl_io_data_dump(server_rec *srvr,
-                             const char *s,
+static void ssl_io_data_dump(server_rec *s,
+                             const char *b,
                              long len)
 {
     char buf[256];
@@ -1964,12 +1964,12 @@ static void ssl_io_data_dump(server_rec *srvr,
     unsigned char ch;
 
     trunc = 0;
-    for(; (len > 0) && ((s[len-1] == ' ') || (s[len-1] == '\0')); len--)
+    for(; (len > 0) && ((b[len-1] == ' ') || (b[len-1] == '\0')); len--)
         trunc++;
     rows = (len / DUMP_WIDTH);
     if ((rows * DUMP_WIDTH) < len)
         rows++;
-    ap_log_error(APLOG_MARK, APLOG_TRACE7, 0, srvr,
+    ap_log_error(APLOG_MARK, APLOG_TRACE7, 0, s,
             "+-------------------------------------------------------------------------+");
     for(i = 0 ; i< rows; i++) {
 #if APR_CHARSET_EBCDIC
@@ -1979,7 +1979,7 @@ static void ssl_io_data_dump(server_rec *srvr,
             j = len % DUMP_WIDTH;
         if (j == 0)
             j = DUMP_WIDTH;
-        memcpy(ebcdic_text,(char *)(s) + i * DUMP_WIDTH, j);
+        memcpy(ebcdic_text,(char *)(b) + i * DUMP_WIDTH, j);
         ap_xlate_proto_from_ascii(ebcdic_text, j);
 #endif /* APR_CHARSET_EBCDIC */
         apr_snprintf(tmp, sizeof(tmp), "| %04x: ", i * DUMP_WIDTH);
@@ -1988,7 +1988,7 @@ static void ssl_io_data_dump(server_rec *srvr,
             if (((i * DUMP_WIDTH) + j) >= len)
                 apr_cpystrn(buf+strlen(buf), "   ", sizeof(buf)-strlen(buf));
             else {
-                ch = ((unsigned char)*((char *)(s) + i * DUMP_WIDTH + j)) & 0xff;
+                ch = ((unsigned char)*((char *)(b) + i * DUMP_WIDTH + j)) & 0xff;
                 apr_snprintf(tmp, sizeof(tmp), "%02x%c", ch , j==7 ? '-' : ' ');
                 apr_cpystrn(buf+strlen(buf), tmp, sizeof(buf)-strlen(buf));
             }
@@ -1998,7 +1998,7 @@ static void ssl_io_data_dump(server_rec *srvr,
             if (((i * DUMP_WIDTH) + j) >= len)
                 apr_cpystrn(buf+strlen(buf), " ", sizeof(buf)-strlen(buf));
             else {
-                ch = ((unsigned char)*((char *)(s) + i * DUMP_WIDTH + j)) & 0xff;
+                ch = ((unsigned char)*((char *)(b) + i * DUMP_WIDTH + j)) & 0xff;
 #if APR_CHARSET_EBCDIC
                 apr_snprintf(tmp, sizeof(tmp), "%c", (ch >= 0x20 && ch <= 0x7F) ? ebcdic_text[j] : '.');
 #else /* APR_CHARSET_EBCDIC */
@@ -2008,13 +2008,12 @@ static void ssl_io_data_dump(server_rec *srvr,
             }
         }
         apr_cpystrn(buf+strlen(buf), " |", sizeof(buf)-strlen(buf));
-        ap_log_error(APLOG_MARK, APLOG_TRACE7, 0, srvr,
-                     "%s", buf);
+        ap_log_error(APLOG_MARK, APLOG_TRACE7, 0, s, "%s", buf);
     }
     if (trunc > 0)
-        ap_log_error(APLOG_MARK, APLOG_TRACE7, 0, srvr,
+        ap_log_error(APLOG_MARK, APLOG_TRACE7, 0, s,
                 "| %04ld - <SPACES/NULS>", len + trunc);
-    ap_log_error(APLOG_MARK, APLOG_TRACE7, 0, srvr,
+    ap_log_error(APLOG_MARK, APLOG_TRACE7, 0, s,
             "+-------------------------------------------------------------------------+");
     return;
 }
index a1f8734cab31404ff00f87d8f435470ca2b21ccc..e158a4765af44998c73f2d4801aa6a9f018d5b2a 100644 (file)
@@ -415,12 +415,10 @@ static apr_status_t ssl_pipe_child_create(apr_pool_t *p, const char *progname)
                                    APR_FULL_BLOCK,
                                    APR_NO_PIPE)) == APR_SUCCESS)) {
         char **args;
-        const char *pname;
 
         apr_tokenize_to_argv(progname, &args, p);
-        pname = apr_pstrdup(p, args[0]);
         procnew = (apr_proc_t *)apr_pcalloc(p, sizeof(*procnew));
-        rc = apr_proc_create(procnew, pname, (const char * const *)args,
+        rc = apr_proc_create(procnew, args[0], (const char * const *)args,
                              NULL, procattr, p);
         if (rc == APR_SUCCESS) {
             /* XXX: not sure if we aught to...
index 5acdb547e561a6c04a36f3159fe7a3fc707c6da8..499be515e828bfffd61fb41c71a9b1e17fb7cd32 100644 (file)
@@ -555,7 +555,7 @@ static int read_request_line(request_rec *r, apr_bucket_brigade *bb)
     const char *uri;
     const char *pro;
 
-    int major = 1, minor = 0;   /* Assume HTTP/1.0 if non-"HTTP" protocol */
+    unsigned int major = 1, minor = 0;   /* Assume HTTP/1.0 if non-"HTTP" protocol */
     char http[5];
     apr_size_t len;
     int num_blank_lines = 0;