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:
&& 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 */
* 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;
* 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;
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);
* 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);
/*
* 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,
/* 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;
}
/* 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];
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;
}
}
}
/* 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")
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);
#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];
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
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);
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));
}
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 */
}
}
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;
}
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...
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;