From 5061d9fa920cb1821a51495fc42833c54e5bd714 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 10 Nov 2005 15:11:44 +0000 Subject: No functional Change: Removing trailing whitespace. This also means that "blank" lines consisting of just spaces or tabs are now really blank lines git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68 --- modules/aaa/mod_auth_basic.c | 4 +- modules/aaa/mod_auth_digest.c | 58 +-- modules/aaa/mod_authn_alias.c | 26 +- modules/aaa/mod_authn_anon.c | 10 +- modules/aaa/mod_authn_dbd.c | 2 +- modules/aaa/mod_authn_dbm.c | 14 +- modules/aaa/mod_authnz_ldap.c | 150 +++--- modules/aaa/mod_authz_dbm.c | 8 +- modules/aaa/mod_authz_default.c | 4 +- modules/aaa/mod_authz_groupfile.c | 22 +- modules/aaa/mod_authz_host.c | 6 +- modules/aaa/mod_authz_owner.c | 2 +- modules/aaa/mod_authz_user.c | 6 +- modules/arch/netware/libprews.c | 4 +- modules/arch/netware/mod_netware.c | 12 +- modules/arch/netware/mod_nw_ssl.c | 166 +++---- modules/arch/win32/mod_isapi.c | 246 ++++----- modules/arch/win32/mod_win32.c | 60 +-- modules/cache/cache_hash.c | 4 +- modules/cache/cache_storage.c | 18 +- modules/cache/cache_util.c | 32 +- modules/cache/mod_cache.c | 88 ++-- modules/cache/mod_disk_cache.c | 28 +- modules/cache/mod_file_cache.c | 40 +- modules/cache/mod_mem_cache.c | 134 ++--- modules/dav/fs/dbm.c | 4 +- modules/dav/fs/lock.c | 26 +- modules/dav/fs/repos.c | 44 +- modules/dav/lock/locks.c | 4 +- modules/dav/main/liveprop.c | 2 +- modules/dav/main/mod_dav.c | 20 +- modules/dav/main/util.c | 70 +-- modules/dav/main/util_lock.c | 12 +- modules/debug/mod_bucketeer.c | 12 +- modules/debug/mod_dumpio.c | 16 +- modules/echo/mod_echo.c | 4 +- modules/experimental/mod_case_filter.c | 2 +- modules/experimental/mod_case_filter_in.c | 8 +- modules/experimental/mod_example.c | 24 +- modules/filters/mod_charset_lite.c | 114 ++--- modules/filters/mod_deflate.c | 22 +- modules/filters/mod_ext_filter.c | 78 +-- modules/filters/mod_filter.c | 8 +- modules/filters/mod_include.c | 40 +- modules/generators/mod_asis.c | 4 +- modules/generators/mod_autoindex.c | 4 +- modules/generators/mod_cgi.c | 54 +- modules/generators/mod_cgid.c | 798 +++++++++++++++--------------- modules/generators/mod_info.c | 14 +- modules/generators/mod_status.c | 28 +- modules/http/byterange_filter.c | 10 +- modules/http/chunk_filter.c | 2 +- modules/http/http_core.c | 26 +- modules/http/http_etag.c | 4 +- modules/http/http_filters.c | 40 +- modules/http/http_protocol.c | 20 +- modules/http/http_request.c | 30 +- modules/http/mod_mime.c | 80 +-- modules/ldap/util_ldap.c | 388 +++++++-------- modules/ldap/util_ldap_cache.c | 18 +- modules/ldap/util_ldap_cache_mgr.c | 52 +- modules/loggers/mod_log_config.c | 58 +-- modules/loggers/mod_log_forensic.c | 2 +- modules/loggers/mod_logio.c | 2 +- modules/mappers/mod_actions.c | 12 +- modules/mappers/mod_alias.c | 16 +- modules/mappers/mod_dir.c | 16 +- modules/mappers/mod_imagemap.c | 8 +- modules/mappers/mod_negotiation.c | 2 +- modules/mappers/mod_rewrite.c | 10 +- modules/mappers/mod_so.c | 58 +-- modules/mappers/mod_speling.c | 12 +- modules/mappers/mod_userdir.c | 10 +- modules/mappers/mod_vhost_alias.c | 28 +- modules/metadata/mod_cern_meta.c | 20 +- modules/metadata/mod_env.c | 8 +- modules/metadata/mod_expires.c | 24 +- modules/metadata/mod_headers.c | 44 +- modules/metadata/mod_mime_magic.c | 20 +- modules/metadata/mod_setenvif.c | 10 +- modules/metadata/mod_unique_id.c | 18 +- modules/metadata/mod_usertrack.c | 6 +- modules/metadata/mod_version.c | 4 +- modules/proxy/ajp_header.c | 46 +- modules/proxy/ajp_link.c | 12 +- modules/proxy/ajp_msg.c | 44 +- modules/proxy/mod_proxy.c | 120 ++--- modules/proxy/mod_proxy_ajp.c | 2 +- modules/proxy/mod_proxy_balancer.c | 94 ++-- modules/proxy/mod_proxy_connect.c | 12 +- modules/proxy/mod_proxy_ftp.c | 28 +- modules/proxy/mod_proxy_http.c | 90 ++-- modules/proxy/proxy_util.c | 46 +- modules/ssl/mod_ssl.c | 16 +- modules/ssl/ssl_engine_config.c | 26 +- modules/ssl/ssl_engine_dh.c | 6 +- modules/ssl/ssl_engine_init.c | 22 +- modules/ssl/ssl_engine_io.c | 86 ++-- modules/ssl/ssl_engine_kernel.c | 60 +-- modules/ssl/ssl_engine_log.c | 6 +- modules/ssl/ssl_engine_mutex.c | 2 +- modules/ssl/ssl_engine_pphrase.c | 24 +- modules/ssl/ssl_engine_rand.c | 4 +- modules/ssl/ssl_engine_vars.c | 30 +- modules/ssl/ssl_expr_eval.c | 2 +- modules/ssl/ssl_expr_parse.c | 10 +- modules/ssl/ssl_expr_scan.c | 18 +- modules/ssl/ssl_scache.c | 2 +- modules/ssl/ssl_scache_dbm.c | 6 +- modules/ssl/ssl_scache_dc.c | 6 +- modules/ssl/ssl_scache_shmcb.c | 44 +- modules/ssl/ssl_util.c | 28 +- modules/ssl/ssl_util_ssl.c | 20 +- 113 files changed, 2263 insertions(+), 2263 deletions(-) (limited to 'modules') diff --git a/modules/aaa/mod_auth_basic.c b/modules/aaa/mod_auth_basic.c index ee296a4491..c6192b36ef 100644 --- a/modules/aaa/mod_auth_basic.c +++ b/modules/aaa/mod_auth_basic.c @@ -256,7 +256,7 @@ static int authenticate_basic_user(request_rec *r) current_provider = current_provider->next; } while (current_provider); - + if (auth_result != AUTH_GRANTED) { int return_code; @@ -280,7 +280,7 @@ static int authenticate_basic_user(request_rec *r) break; case AUTH_GENERAL_ERROR: default: - /* We'll assume that the module has already said what its error + /* We'll assume that the module has already said what its error * was in the logs. */ return_code = HTTP_INTERNAL_SERVER_ERROR; diff --git a/modules/aaa/mod_auth_digest.c b/modules/aaa/mod_auth_digest.c index 395fee0711..8a0ee5a130 100644 --- a/modules/aaa/mod_auth_digest.c +++ b/modules/aaa/mod_auth_digest.c @@ -51,7 +51,7 @@ * The only problem is that it allows replay attacks when somebody * captures a packet sent to one server and sends it to another * one. Should we add "AuthDigestNcCheck Strict"? - * - expired nonces give amaya fits. + * - expired nonces give amaya fits. */ #include "apr_sha1.h" @@ -80,8 +80,8 @@ #include "mod_auth.h" -/* Disable shmem until pools/init gets sorted out - * remove following two lines when fixed +/* Disable shmem until pools/init gets sorted out + * remove following two lines when fixed */ #undef APR_HAS_SHARED_MEMORY #define APR_HAS_SHARED_MEMORY 0 @@ -200,7 +200,7 @@ module AP_MODULE_DECLARE_DATA auth_digest_module; static apr_status_t cleanup_tables(void *not_used) { - ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "Digest: cleaning up shared memory"); fflush(stderr); @@ -238,7 +238,7 @@ static apr_status_t initialize_secret(server_rec *s) if (status != APR_SUCCESS) { char buf[120]; ap_log_error(APLOG_MARK, APLOG_CRIT, status, s, - "Digest: error generating secret: %s", + "Digest: error generating secret: %s", apr_strerror(status, buf, sizeof(buf))); return status; } @@ -447,13 +447,13 @@ static const char *add_authn_provider(cmd_parms *cmd, void *config, digest_config_rec *conf = (digest_config_rec*)config; authn_provider_list *newp; const char *provider_name; - + if (strcasecmp(arg, "on") == 0) { provider_name = AUTHN_DEFAULT_PROVIDER; } else if (strcasecmp(arg, "off") == 0) { /* Clear all configured providers and return. */ - conf->providers = NULL; + conf->providers = NULL; return NULL; } else { @@ -540,7 +540,7 @@ static const char *set_nonce_lifetime(cmd_parms *cmd, void *config, char *endptr; long lifetime; - lifetime = strtol(t, &endptr, 10); + lifetime = strtol(t, &endptr, 10); if (endptr < (t+strlen(t)) && !apr_isspace(*endptr)) { return apr_pstrcat(cmd->pool, "Invalid time in AuthDigestNonceLifetime: ", @@ -608,7 +608,7 @@ static const char *set_shmem_size(cmd_parms *cmd, void *config, char *endptr; long size, min; - size = strtol(size_str, &endptr, 10); + size = strtol(size_str, &endptr, 10); while (apr_isspace(*endptr)) endptr++; if (*endptr == '\0' || *endptr == 'b' || *endptr == 'B') { ; @@ -645,23 +645,23 @@ static const char *set_shmem_size(cmd_parms *cmd, void *config, static const command_rec digest_cmds[] = { - AP_INIT_TAKE1("AuthName", set_realm, NULL, OR_AUTHCFG, + AP_INIT_TAKE1("AuthName", set_realm, NULL, OR_AUTHCFG, "The authentication realm (e.g. \"Members Only\")"), AP_INIT_ITERATE("AuthDigestProvider", add_authn_provider, NULL, OR_AUTHCFG, "specify the auth providers for a directory or location"), - AP_INIT_ITERATE("AuthDigestQop", set_qop, NULL, OR_AUTHCFG, + AP_INIT_ITERATE("AuthDigestQop", set_qop, NULL, OR_AUTHCFG, "A list of quality-of-protection options"), - AP_INIT_TAKE1("AuthDigestNonceLifetime", set_nonce_lifetime, NULL, OR_AUTHCFG, + AP_INIT_TAKE1("AuthDigestNonceLifetime", set_nonce_lifetime, NULL, OR_AUTHCFG, "Maximum lifetime of the server nonce (seconds)"), - AP_INIT_TAKE1("AuthDigestNonceFormat", set_nonce_format, NULL, OR_AUTHCFG, + AP_INIT_TAKE1("AuthDigestNonceFormat", set_nonce_format, NULL, OR_AUTHCFG, "The format to use when generating the server nonce"), - AP_INIT_FLAG("AuthDigestNcCheck", set_nc_check, NULL, OR_AUTHCFG, + AP_INIT_FLAG("AuthDigestNcCheck", set_nc_check, NULL, OR_AUTHCFG, "Whether or not to check the nonce-count sent by the client"), - AP_INIT_TAKE1("AuthDigestAlgorithm", set_algorithm, NULL, OR_AUTHCFG, + AP_INIT_TAKE1("AuthDigestAlgorithm", set_algorithm, NULL, OR_AUTHCFG, "The algorithm used for the hash calculation"), - AP_INIT_ITERATE("AuthDigestDomain", set_uri_list, NULL, OR_AUTHCFG, + AP_INIT_ITERATE("AuthDigestDomain", set_uri_list, NULL, OR_AUTHCFG, "A list of URI's which belong to the same protection space as the current URI"), - AP_INIT_TAKE1("AuthDigestShmemSize", set_shmem_size, NULL, RSRC_CONF, + AP_INIT_TAKE1("AuthDigestShmemSize", set_shmem_size, NULL, RSRC_CONF, "The amount of shared memory to allocate for keeping track of clients"), {NULL} }; @@ -1300,13 +1300,13 @@ static void note_digest_auth_failure(request_rec *r, * unneccessarily (it's usually > 200 bytes!). */ - + /* don't send domain * - for proxy requests * - if it's no specified */ if (r->proxyreq || !conf->uri_list) { - domain = NULL; + domain = NULL; } else { domain = conf->uri_list; @@ -1464,7 +1464,7 @@ static int check_nonce(request_rec *r, digest_header_rec *resp, if (dt > conf->nonce_lifetime) { ap_log_rerror(APLOG_MARK, APLOG_INFO, 0,r, "Digest: user %s: nonce expired (%.2f seconds old " - "- max lifetime %.2f) - sending new nonce", + "- max lifetime %.2f) - sending new nonce", r->user, (double)apr_time_sec(dt), (double)apr_time_sec(conf->nonce_lifetime)); note_digest_auth_failure(r, conf, resp, 1); @@ -1536,7 +1536,7 @@ static const char *new_digest(const request_rec *r, } -static void copy_uri_components(apr_uri_t *dst, +static void copy_uri_components(apr_uri_t *dst, apr_uri_t *src, request_rec *r) { if (src->scheme && src->scheme[0] != '\0') { dst->scheme = src->scheme; @@ -1684,30 +1684,30 @@ static int authenticate_digest_user(request_rec *r) ap_unescape_url(d_uri.query); } else if (r_uri.query) { - /* MSIE compatibility hack. MSIE has some RFC issues - doesn't + /* MSIE compatibility hack. MSIE has some RFC issues - doesn't * include the query string in the uri Authorization component * or when computing the response component. the second part * works out ok, since we can hash the header and get the same * result. however, the uri from the request line won't match - * the uri Authorization component since the header lacks the + * the uri Authorization component since the header lacks the * query string, leaving us incompatable with a (broken) MSIE. - * + * * the workaround is to fake a query string match if in the proper * environment - BrowserMatch MSIE, for example. the cool thing - * is that if MSIE ever fixes itself the simple match ought to + * is that if MSIE ever fixes itself the simple match ought to * work and this code won't be reached anyway, even if the * environment is set. */ - if (apr_table_get(r->subprocess_env, + if (apr_table_get(r->subprocess_env, "AuthDigestEnableQueryStringHack")) { - + ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, "Digest: " "applying AuthDigestEnableQueryStringHack " "to uri <%s>", resp->raw_request_uri); d_uri.query = r_uri.query; - } + } } if (r->method_number == M_CONNECT) { @@ -1800,7 +1800,7 @@ static int authenticate_digest_user(request_rec *r) */ return HTTP_INTERNAL_SERVER_ERROR; } - + if (resp->message_qop == NULL) { /* old (rfc-2069) style digest */ if (strcmp(resp->digest, old_digest(r, resp, conf->ha1))) { diff --git a/modules/aaa/mod_authn_alias.c b/modules/aaa/mod_authn_alias.c index 83d067774f..648ab059b9 100644 --- a/modules/aaa/mod_authn_alias.c +++ b/modules/aaa/mod_authn_alias.c @@ -51,19 +51,19 @@ static authn_status authn_alias_check_password(request_rec *r, const char *user, const char *provider_name = apr_table_get(r->notes, AUTHN_PROVIDER_NAME_NOTE); authn_status ret = AUTH_USER_NOT_FOUND; - authn_alias_srv_conf *authcfg = - (authn_alias_srv_conf *)ap_get_module_config(r->server->module_config, + authn_alias_srv_conf *authcfg = + (authn_alias_srv_conf *)ap_get_module_config(r->server->module_config, &authn_alias_module); if (provider_name) { - provider_alias_rec *prvdraliasrec = apr_hash_get(authcfg->alias_rec, + provider_alias_rec *prvdraliasrec = apr_hash_get(authcfg->alias_rec, provider_name, APR_HASH_KEY_STRING); ap_conf_vector_t *orig_dir_config = r->per_dir_config; - /* If we found the alias provider in the list, then merge the directory + /* If we found the alias provider in the list, then merge the directory configurations and call the real provider */ if (prvdraliasrec) { - r->per_dir_config = ap_merge_per_dir_configs(r->pool, orig_dir_config, + r->per_dir_config = ap_merge_per_dir_configs(r->pool, orig_dir_config, prvdraliasrec->sec_auth); ret = prvdraliasrec->provider->check_password(r,user,password); r->per_dir_config = orig_dir_config; @@ -83,19 +83,19 @@ static authn_status authn_alias_get_realm_hash(request_rec *r, const char *user, const char *provider_name = apr_table_get(r->notes, AUTHN_PROVIDER_NAME_NOTE); authn_status ret = AUTH_USER_NOT_FOUND; - authn_alias_srv_conf *authcfg = - (authn_alias_srv_conf *)ap_get_module_config(r->server->module_config, + authn_alias_srv_conf *authcfg = + (authn_alias_srv_conf *)ap_get_module_config(r->server->module_config, &authn_alias_module); if (provider_name) { - provider_alias_rec *prvdraliasrec = apr_hash_get(authcfg->alias_rec, + provider_alias_rec *prvdraliasrec = apr_hash_get(authcfg->alias_rec, provider_name, APR_HASH_KEY_STRING); ap_conf_vector_t *orig_dir_config = r->per_dir_config; - /* If we found the alias provider in the list, then merge the directory + /* If we found the alias provider in the list, then merge the directory configurations and call the real provider */ if (prvdraliasrec) { - r->per_dir_config = ap_merge_per_dir_configs(r->pool, orig_dir_config, + r->per_dir_config = ap_merge_per_dir_configs(r->pool, orig_dir_config, prvdraliasrec->sec_auth); ret = prvdraliasrec->provider->get_realm_hash(r,user,realm,rethash); r->per_dir_config = orig_dir_config; @@ -131,8 +131,8 @@ static const char *authaliassection(cmd_parms *cmd, void *mconfig, const char *a char *provider_name; const char *errmsg; ap_conf_vector_t *new_auth_config = ap_create_per_dir_config(cmd->pool); - authn_alias_srv_conf *authcfg = - (authn_alias_srv_conf *)ap_get_module_config(cmd->server->module_config, + authn_alias_srv_conf *authcfg = + (authn_alias_srv_conf *)ap_get_module_config(cmd->server->module_config, &authn_alias_module); const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); @@ -170,7 +170,7 @@ static const char *authaliassection(cmd_parms *cmd, void *mconfig, const char *a provider_alias_rec *prvdraliasrec = apr_pcalloc(cmd->pool, sizeof(provider_alias_rec)); const authn_provider *provider = ap_lookup_provider(AUTHN_PROVIDER_GROUP, provider_name,"0"); - /* Save off the new directory config along with the original provider name + /* Save off the new directory config along with the original provider name and function pointer data */ prvdraliasrec->sec_auth = new_auth_config; prvdraliasrec->provider_name = provider_name; diff --git a/modules/aaa/mod_authn_anon.c b/modules/aaa/mod_authn_anon.c index b0e48fbbdd..e3c308d651 100644 --- a/modules/aaa/mod_authn_anon.c +++ b/modules/aaa/mod_authn_anon.c @@ -20,7 +20,7 @@ * as the password. * * Just add the following tokes to your setup: - * + * * Anonymous magic-userid [magic-userid]... * * Anonymous_MustGiveEmail [ on | off ] default = on @@ -28,8 +28,8 @@ * Anonymous_VerifyEmail [ on | off ] default = off * Anonymous_NoUserId [ on | off ] default = off * - * The magic user id is something like 'anonymous', it is NOT case sensitive. - * + * The magic user id is something like 'anonymous', it is NOT case sensitive. + * * The MustGiveEmail flag can be used to force users to enter something * in the password field (like an email address). Default is on. * @@ -38,7 +38,7 @@ * in broken GUIs like W95 is often given by the user. The Default is off. * * Dirk.vanGulik@jrc.it; http://ewse.ceo.org; http://me-www.jrc.it/~dirkx - * + * */ #include "apr_strings.h" @@ -113,7 +113,7 @@ static const char *anon_set_string_slots(cmd_parms *cmd, static const command_rec authn_anon_cmds[] = { - AP_INIT_ITERATE("Anonymous", anon_set_string_slots, NULL, OR_AUTHCFG, + AP_INIT_ITERATE("Anonymous", anon_set_string_slots, NULL, OR_AUTHCFG, "a space-separated list of user IDs"), AP_INIT_FLAG("Anonymous_MustGiveEmail", ap_set_flag_slot, (void *)APR_OFFSETOF(authn_anon_config_rec, mustemail), diff --git a/modules/aaa/mod_authn_dbd.c b/modules/aaa/mod_authn_dbd.c index 39e75621ab..15d1ae4bb2 100644 --- a/modules/aaa/mod_authn_dbd.c +++ b/modules/aaa/mod_authn_dbd.c @@ -202,7 +202,7 @@ static void authn_dbd_hooks(apr_pool_t *p) &authn_dbd_password, &authn_dbd_realm }; - + ap_register_provider(p, AUTHN_PROVIDER_GROUP, "dbd", "0", &authn_dbd_provider); } module AP_MODULE_DECLARE_DATA authn_dbd_module = diff --git a/modules/aaa/mod_authn_dbm.c b/modules/aaa/mod_authn_dbm.c index 2f66203212..d9ed980bc1 100644 --- a/modules/aaa/mod_authn_dbm.c +++ b/modules/aaa/mod_authn_dbm.c @@ -16,9 +16,9 @@ /* * http_auth: authentication - * + * * Rob McCool & Brian Behlendorf. - * + * * Adapted to Apache by rst. * */ @@ -54,12 +54,12 @@ static void *create_authn_dbm_dir_config(apr_pool_t *p, char *d) return conf; } -static const char *set_dbm_type(cmd_parms *cmd, - void *dir_config, +static const char *set_dbm_type(cmd_parms *cmd, + void *dir_config, const char *arg) { authn_dbm_config_rec *conf = dir_config; - + conf->dbmtype = apr_pstrdup(cmd->pool, arg); return NULL; } @@ -85,7 +85,7 @@ static apr_status_t fetch_dbm_value(const char *dbmtype, const char *dbmfile, apr_datum_t key, val; apr_status_t rv; - rv = apr_dbm_open_ex(&f, dbmtype, dbmfile, APR_DBM_READONLY, + rv = apr_dbm_open_ex(&f, dbmtype, dbmfile, APR_DBM_READONLY, APR_OS_DEFAULT, pool); if (rv != APR_SUCCESS) { @@ -106,7 +106,7 @@ static apr_status_t fetch_dbm_value(const char *dbmtype, const char *dbmfile, } apr_dbm_close(f); - + return rv; } diff --git a/modules/aaa/mod_authnz_ldap.c b/modules/aaa/mod_authnz_ldap.c index e1ef01bb01..586f80bf43 100644 --- a/modules/aaa/mod_authnz_ldap.c +++ b/modules/aaa/mod_authnz_ldap.c @@ -67,9 +67,9 @@ typedef struct { int compare_dn_on_server; /* If true, will use server to do DN compare */ int have_ldap_url; /* Set if we have found an LDAP url */ - + apr_array_header_t *groupattr; /* List of Group attributes */ - int group_attrib_is_dn; /* If true, the group attribute is the DN, otherwise, + int group_attrib_is_dn; /* If true, the group attribute is the DN, otherwise, it's the exact string passed by the HTTP client */ int secure; /* True if SSL connections are requested */ @@ -106,12 +106,12 @@ static char* derive_codepage_from_lang (apr_pool_t *p, char *language) { int lang_len; char *charset; - + if (!language) /* our default codepage */ return apr_pstrdup(p, "ISO-8859-1"); else lang_len = strlen(language); - + charset = (char*) apr_hash_get(charset_conversions, language, APR_HASH_KEY_STRING); if (!charset) { @@ -163,14 +163,14 @@ static apr_xlate_t* get_conv_set (request_rec *r) * combined with a filter made up of the attribute provided with the URL, * and the actual username passed by the HTTP client. For example, assume * that the LDAP URL is - * + * * ldap://ldap.airius.com/ou=People, o=Airius?uid??(posixid=*) * * Further, assume that the userid passed by the client was `userj'. The * search filter will be (&(posixid=*)(uid=userj)). */ #define FILTER_LENGTH MAX_STRING_LEN -static void authn_ldap_build_filter(char *filtbuf, +static void authn_ldap_build_filter(char *filtbuf, request_rec *r, const char* sent_user, const char* sent_filter, @@ -210,13 +210,13 @@ static void authn_ldap_build_filter(char *filtbuf, } } - /* - * Create the first part of the filter, which consists of the + /* + * Create the first part of the filter, which consists of the * config-supplied portions. */ apr_snprintf(filtbuf, FILTER_LENGTH, "(&(%s)(%s=", filter, sec->attribute); - /* + /* * Now add the client-supplied username to the filter, ensuring that any * LDAP filter metachars are escaped. */ @@ -264,8 +264,8 @@ static void authn_ldap_build_filter(char *filtbuf, #endif *q = '\0'; - /* - * Append the closing parens of the filter, unless doing so would + /* + * Append the closing parens of the filter, unless doing so would * overrun the buffer. */ if (q + 2 <= filtbuf_end) @@ -274,7 +274,7 @@ static void authn_ldap_build_filter(char *filtbuf, static void *create_authnz_ldap_dir_config(apr_pool_t *p, char *d) { - authn_ldap_config_t *sec = + authn_ldap_config_t *sec = (authn_ldap_config_t *)apr_pcalloc(p, sizeof(authn_ldap_config_t)); sec->pool = p; @@ -284,7 +284,7 @@ static void *create_authnz_ldap_dir_config(apr_pool_t *p, char *d) /* sec->authz_enabled = 1; */ - sec->groupattr = apr_array_make(p, GROUPATTR_MAX_ELTS, + sec->groupattr = apr_array_make(p, GROUPATTR_MAX_ELTS, sizeof(struct mod_auth_ldap_groupattr_entry_t)); sec->have_ldap_url = 0; @@ -347,9 +347,9 @@ static authn_status authn_ldap_check_password(request_rec *r, const char *user, if (!sec->enabled) { return AUTH_USER_NOT_FOUND; } -*/ +*/ - /* + /* * Basic sanity checks before any LDAP operations even happen. */ if (!sec->have_ldap_url) { @@ -365,7 +365,7 @@ start_over: sec->secure); } else { - ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authenticate: no sec->host - weird...?", getpid()); return AUTH_GENERAL_ERROR; } @@ -405,7 +405,7 @@ start_over: /* handle bind failure */ if (result != LDAP_SUCCESS) { - ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authenticate: " "user %s authentication failed; URI %s [%s][%s]", getpid(), user, r->uri, ldc->reason, ldap_err2string(result)); @@ -442,7 +442,7 @@ start_over: } } - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authenticate: accepting %s", getpid(), user); return AUTH_GRANTED; @@ -491,7 +491,7 @@ static int authz_ldap_check_user_access(request_rec *r) if (!sec->enabled) { return DECLINED; } -*/ +*/ if (!sec->have_ldap_url) { return DECLINED; @@ -506,12 +506,12 @@ static int authz_ldap_check_user_access(request_rec *r) apr_pool_cleanup_null); } else { - ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: no sec->host - weird...?", getpid()); return sec->auth_authoritative? HTTP_UNAUTHORIZED : DECLINED; } - /* + /* * If there are no elements in the group attribute array, the default should be * member and uniquemember; populate the array now. */ @@ -583,49 +583,49 @@ static int authz_ldap_check_user_access(request_rec *r) t = reqs[x].requirement; w = ap_getword_white(r->pool, &t); - + if (strcmp(w, "ldap-user") == 0) { if (req->dn == NULL || strlen(req->dn) == 0) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " - "require user: user's DN has not been defined; failing authorisation", + "require user: user's DN has not been defined; failing authorisation", getpid()); return sec->auth_authoritative? HTTP_UNAUTHORIZED : DECLINED; } - /* + /* * First do a whole-line compare, in case it's something like * require user Babs Jensen */ result = util_ldap_cache_compare(r, ldc, sec->url, req->dn, sec->attribute, t); switch(result) { case LDAP_COMPARE_TRUE: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require user: authorisation successful", getpid()); return OK; } default: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: require user: " "authorisation failed [%s][%s]", getpid(), ldc->reason, ldap_err2string(result)); } } - /* - * Now break apart the line and compare each word on it + /* + * Now break apart the line and compare each word on it */ while (t[0]) { w = ap_getword_conf(r->pool, &t); result = util_ldap_cache_compare(r, ldc, sec->url, req->dn, sec->attribute, w); switch(result) { case LDAP_COMPARE_TRUE: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require user: authorisation successful", getpid()); return OK; } default: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require user: authorisation failed [%s][%s]", getpid(), ldc->reason, ldap_err2string(result)); @@ -637,7 +637,7 @@ static int authz_ldap_check_user_access(request_rec *r) if (req->dn == NULL || strlen(req->dn) == 0) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " - "require dn: user's DN has not been defined; failing authorisation", + "require dn: user's DN has not been defined; failing authorisation", getpid()); return sec->auth_authoritative? HTTP_UNAUTHORIZED : DECLINED; } @@ -645,13 +645,13 @@ static int authz_ldap_check_user_access(request_rec *r) result = util_ldap_cache_comparedn(r, ldc, sec->url, req->dn, t, sec->compare_dn_on_server); switch(result) { case LDAP_COMPARE_TRUE: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require dn: authorisation successful", getpid()); return OK; } default: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require dn \"%s\": LDAP error [%s][%s]", getpid(), t, ldc->reason, ldap_err2string(result)); @@ -666,42 +666,42 @@ static int authz_ldap_check_user_access(request_rec *r) if (req->dn == NULL || strlen(req->dn) == 0) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: require group: " - "user's DN has not been defined; failing authorisation", + "user's DN has not been defined; failing authorisation", getpid()); return sec->auth_authoritative? HTTP_UNAUTHORIZED : DECLINED; } } else { if (req->user == NULL || strlen(req->user) == 0) { - /* We weren't called in the authentication phase, so we didn't have a + /* We weren't called in the authentication phase, so we didn't have a * chance to set the user field. Do so now. */ req->user = r->user; } } - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: require group: " - "testing for group membership in \"%s\"", + "testing for group membership in \"%s\"", getpid(), t); for (i = 0; i < sec->groupattr->nelts; i++) { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: require group: " "testing for %s: %s (%s)", getpid(), ent[i].name, sec->group_attrib_is_dn ? req->dn : req->user, t); - result = util_ldap_cache_compare(r, ldc, sec->url, t, ent[i].name, + result = util_ldap_cache_compare(r, ldc, sec->url, t, ent[i].name, sec->group_attrib_is_dn ? req->dn : req->user); switch(result) { case LDAP_COMPARE_TRUE: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: require group: " "authorisation successful (attribute %s) [%s][%s]", getpid(), ent[i].name, ldc->reason, ldap_err2string(result)); return OK; } default: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: require group \"%s\": " "authorisation failed [%s][%s]", getpid(), t, ldc->reason, ldap_err2string(result)); @@ -713,7 +713,7 @@ static int authz_ldap_check_user_access(request_rec *r) if (req->dn == NULL || strlen(req->dn) == 0) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " - "require ldap-attribute: user's DN has not been defined; failing authorisation", + "require ldap-attribute: user's DN has not been defined; failing authorisation", getpid()); return sec->auth_authoritative? HTTP_UNAUTHORIZED : DECLINED; } @@ -728,17 +728,17 @@ static int authz_ldap_check_user_access(request_rec *r) w, value); switch(result) { case LDAP_COMPARE_TRUE: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require attribute: authorisation " "successful", getpid()); return OK; } default: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require attribute: authorisation " - "failed [%s][%s]", getpid(), + "failed [%s][%s]", getpid(), ldc->reason, ldap_err2string(result)); } } @@ -748,13 +748,13 @@ static int authz_ldap_check_user_access(request_rec *r) if (req->dn == NULL || strlen(req->dn) == 0) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " - "require ldap-filter: user's DN has not been defined; failing authorisation", + "require ldap-filter: user's DN has not been defined; failing authorisation", getpid()); return sec->auth_authoritative? HTTP_UNAUTHORIZED : DECLINED; } if (t[0]) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, - "[%" APR_PID_T_FMT "] auth_ldap authorise: checking filter %s", + "[%" APR_PID_T_FMT "] auth_ldap authorise: checking filter %s", getpid(), t); /* Build the username filter */ @@ -767,33 +767,33 @@ static int authz_ldap_check_user_access(request_rec *r) /* Make sure that the filtered search returned the correct user dn */ if (result == LDAP_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, - "[%" APR_PID_T_FMT "] auth_ldap authorise: checking dn match %s", + "[%" APR_PID_T_FMT "] auth_ldap authorise: checking dn match %s", getpid(), dn); - result = util_ldap_cache_comparedn(r, ldc, sec->url, req->dn, dn, + result = util_ldap_cache_comparedn(r, ldc, sec->url, req->dn, dn, sec->compare_dn_on_server); } switch(result) { case LDAP_COMPARE_TRUE: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require ldap-filter: authorisation " "successful", getpid()); return OK; } case LDAP_FILTER_ERROR: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require ldap-filter: %s authorisation " - "failed [%s][%s]", getpid(), + "failed [%s][%s]", getpid(), filtbuf, ldc->reason, ldap_err2string(result)); break; } default: { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: " "require ldap-filter: authorisation " - "failed [%s][%s]", getpid(), + "failed [%s][%s]", getpid(), ldc->reason, ldap_err2string(result)); } } @@ -802,19 +802,19 @@ static int authz_ldap_check_user_access(request_rec *r) } if (!method_restricted) { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, - "[%" APR_PID_T_FMT "] auth_ldap authorise: agreeing because non-restricted", + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + "[%" APR_PID_T_FMT "] auth_ldap authorise: agreeing because non-restricted", getpid()); return OK; } if (!sec->auth_authoritative) { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: declining to authorise", getpid()); return DECLINED; } - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "[%" APR_PID_T_FMT "] auth_ldap authorise: authorisation denied", getpid()); ap_note_basic_auth_failure (r); @@ -822,11 +822,11 @@ static int authz_ldap_check_user_access(request_rec *r) } -/* +/* * Use the ldap url parsing routines to break up the ldap url into * host and port. */ -static const char *mod_auth_ldap_parse_url(cmd_parms *cmd, +static const char *mod_auth_ldap_parse_url(cmd_parms *cmd, void *config, const char *url, const char *mode) @@ -855,9 +855,9 @@ static const char *mod_auth_ldap_parse_url(cmd_parms *cmd, ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, cmd->server, "[%" APR_PID_T_FMT "] auth_ldap url parse: attrib: %s", getpid(), urld->lud_attrs? urld->lud_attrs[0] : "(null)"); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, - cmd->server, "[%" APR_PID_T_FMT "] auth_ldap url parse: scope: %s", getpid(), - (urld->lud_scope == LDAP_SCOPE_SUBTREE? "subtree" : - urld->lud_scope == LDAP_SCOPE_BASE? "base" : + cmd->server, "[%" APR_PID_T_FMT "] auth_ldap url parse: scope: %s", getpid(), + (urld->lud_scope == LDAP_SCOPE_SUBTREE? "subtree" : + urld->lud_scope == LDAP_SCOPE_BASE? "base" : urld->lud_scope == LDAP_SCOPE_ONELEVEL? "onelevel" : "unknown")); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, cmd->server, "[%" APR_PID_T_FMT "] auth_ldap url parse: filter: %s", getpid(), urld->lud_filter); @@ -896,7 +896,7 @@ static const char *mod_auth_ldap_parse_url(cmd_parms *cmd, if (urld->lud_filter) { if (urld->lud_filter[0] == '(') { - /* + /* * Get rid of the surrounding parens; later on when generating the * filter, they'll be put back. */ @@ -939,7 +939,7 @@ static const char *mod_auth_ldap_parse_url(cmd_parms *cmd, else { sec->port = urld->lud_port? urld->lud_port : LDAP_PORT; - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, cmd->server, + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, cmd->server, "LDAP: auth_ldap not using SSL connections"); } @@ -981,7 +981,7 @@ static const char *mod_auth_ldap_add_group_attribute(cmd_parms *cmd, void *confi new = apr_array_push(sec->groupattr); new->name = apr_pstrdup(cmd->pool, arg); - + return NULL; } @@ -994,7 +994,7 @@ static const char *set_charset_config(cmd_parms *cmd, void *config, const char * static const command_rec authnz_ldap_cmds[] = { - AP_INIT_TAKE12("AuthLDAPURL", mod_auth_ldap_parse_url, NULL, OR_AUTHCFG, + AP_INIT_TAKE12("AuthLDAPURL", mod_auth_ldap_parse_url, NULL, OR_AUTHCFG, "URL to define LDAP connection. This should be an RFC 2255 complaint\n" "URL of the form ldap://host[:port]/basedn[?attrib[?scope[?filter]]].\n" "\nFurthermore, the following related " "documents were found:\n
    \n"; } @@ -501,7 +501,7 @@ static int check_speling(request_rec *r) apr_table_mergen(r->subprocess_env, "VARIANTS", apr_array_pstrcat(p, v, ',')); - + apr_pool_destroy(sub_pool); ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, diff --git a/modules/mappers/mod_userdir.c b/modules/mappers/mod_userdir.c index 495f34054a..0c84d4316f 100644 --- a/modules/mappers/mod_userdir.c +++ b/modules/mappers/mod_userdir.c @@ -73,8 +73,8 @@ #endif -/* - * The default directory in user's home dir +/* + * The default directory in user's home dir * In the default install, the module is disabled */ #ifndef DEFAULT_USER_DIR @@ -259,7 +259,7 @@ static int translate_userdir(request_rec *r) * Crummy hack. Need to figure out whether we have been * redirected to a URL or to a file on some drive. Since I * know of no protocols that are a single letter, ignore - * a : as the first or second character, and assume a file + * a : as the first or second character, and assume a file * was specified */ if (strchr(x + 2, ':')) @@ -300,7 +300,7 @@ static int translate_userdir(request_rec *r) * anyway, in the hope that some handler might handle it. This can be * used, for example, to run a CGI script for the user. */ - if (filename && (!*userdirs + if (filename && (!*userdirs || ((rv = apr_stat(&statbuf, filename, APR_FINFO_MIN, r->pool)) == APR_SUCCESS || rv == APR_INCOMPLETE))) { @@ -342,7 +342,7 @@ static ap_unix_identity_t *get_suexec_id_doer(const request_rec *r) } ugid->userdir = 1; -#endif +#endif return ugid; } #endif /* HAVE_UNIX_SUEXEC */ diff --git a/modules/mappers/mod_vhost_alias.c b/modules/mappers/mod_vhost_alias.c index 5dd54f843f..4d3e1c823e 100644 --- a/modules/mappers/mod_vhost_alias.c +++ b/modules/mappers/mod_vhost_alias.c @@ -16,7 +16,7 @@ /* * mod_vhost_alias.c: support for dynamically configured mass virtual hosting - * + * * Copyright (c) 1998-1999 Demon Internet Ltd. * * This software was submitted by Demon Internet to the Apache Software Foundation @@ -123,7 +123,7 @@ static const char *vhost_alias_set(cmd_parms *cmd, void *dummy, const char *map) mva_mode_e mode, *pmode; const char **pmap; const char *p; - + conf = (mva_sconf_t *) ap_get_module_config(cmd->server->module_config, &vhost_alias_module); /* there ought to be a better way of doing this */ @@ -214,17 +214,17 @@ static const char *vhost_alias_set(cmd_parms *cmd, void *dummy, const char *map) static const command_rec mva_commands[] = { - AP_INIT_TAKE1("VirtualScriptAlias", vhost_alias_set, - &vhost_alias_set_cgi_root_name, RSRC_CONF, + AP_INIT_TAKE1("VirtualScriptAlias", vhost_alias_set, + &vhost_alias_set_cgi_root_name, RSRC_CONF, "how to create a ScriptAlias based on the host"), - AP_INIT_TAKE1("VirtualDocumentRoot", vhost_alias_set, - &vhost_alias_set_doc_root_name, RSRC_CONF, + AP_INIT_TAKE1("VirtualDocumentRoot", vhost_alias_set, + &vhost_alias_set_doc_root_name, RSRC_CONF, "how to create the DocumentRoot based on the host"), - AP_INIT_TAKE1("VirtualScriptAliasIP", vhost_alias_set, - &vhost_alias_set_cgi_root_ip, RSRC_CONF, + AP_INIT_TAKE1("VirtualScriptAliasIP", vhost_alias_set, + &vhost_alias_set_cgi_root_ip, RSRC_CONF, "how to create a ScriptAlias based on the host"), - AP_INIT_TAKE1("VirtualDocumentRootIP", vhost_alias_set, - &vhost_alias_set_doc_root_ip, RSRC_CONF, + AP_INIT_TAKE1("VirtualDocumentRootIP", vhost_alias_set, + &vhost_alias_set_doc_root_ip, RSRC_CONF, "how to create the DocumentRoot based on the host"), { NULL } }; @@ -276,7 +276,7 @@ static void vhost_alias_interpolate(request_rec *r, const char *name, dots[ndots] = p; r->filename = NULL; - + dest = buf; last = '\0'; while (*map) { @@ -386,7 +386,7 @@ static int mva_translate(request_rec *r) const char *name, *map, *uri; mva_mode_e mode; const char *cgi; - + conf = (mva_sconf_t *) ap_get_module_config(r->server->module_config, &vhost_alias_module); cgi = NULL; @@ -409,7 +409,7 @@ static int mva_translate(request_rec *r) else { return DECLINED; } - + if (mode == VHOST_ALIAS_NAME) { name = ap_get_server_name(r); } @@ -421,7 +421,7 @@ static int mva_translate(request_rec *r) } /* ### There is an optimization available here to determine the - * absolute portion of the path from the server config phase, + * absolute portion of the path from the server config phase, * through the first % segment, and note that portion of the path * canonical_path buffer. */ diff --git a/modules/metadata/mod_cern_meta.c b/modules/metadata/mod_cern_meta.c index ebe5933154..2afe210d7a 100644 --- a/modules/metadata/mod_cern_meta.c +++ b/modules/metadata/mod_cern_meta.c @@ -18,13 +18,13 @@ * mod_cern_meta.c * version 0.1.0 * status beta - * + * * Andrew Wilson 25.Jan.96 * * *** IMPORTANT *** * This version of mod_cern_meta.c controls Meta File behaviour on a * per-directory basis. Previous versions of the module defined behaviour - * on a per-server basis. The upshot is that you'll need to revisit your + * on a per-server basis. The upshot is that you'll need to revisit your * configuration files in order to make use of the new module. * *** * @@ -38,30 +38,30 @@ * who can exploit this module. It should be noted that there are probably * more sensitive ways of managing the Expires: header specifically. * - * The module obeys the following directives, which can appear + * The module obeys the following directives, which can appear * in the server's .conf files and in .htaccess files. * - * MetaFiles + * MetaFiles * - * turns on|off meta file processing for any directory. + * turns on|off meta file processing for any directory. * Default value is off * * # turn on MetaFiles in this directory * MetaFiles on * * MetaDir - * + * * specifies the name of the directory in which Apache can find * meta information files. The directory is usually a 'hidden' * subdirectory of the directory that contains the file being * accessed. eg: * - * # .meta files are in the *same* directory as the + * # .meta files are in the *same* directory as the * # file being accessed * MetaDir . * * the default is to look in a '.web' subdirectory. This is the - * same as for CERN 3.+ webservers and behaviour is the same as + * same as for CERN 3.+ webservers and behaviour is the same as * for the directive: * * MetaDir .web @@ -87,7 +87,7 @@ * * DOCUMENT_ROOT/somedir/.web/index.html.meta * - * and will use its contents to generate additional MIME header + * and will use its contents to generate additional MIME header * information. * * For more information on the CERN Meta file semantics see: @@ -98,7 +98,7 @@ * 29.Jan.96 pfopen/pfclose instead of fopen/fclose * DECLINE when real file not found, we may be checking each * of the index.html/index.shtml/index.htm variants and don't - * need to report missing ones as spurious errors. + * need to report missing ones as spurious errors. * 31.Jan.96 log_error reports about a malformed .meta file, rather * than a script error. * 20.Jun.96 MetaFiles default off, added, so that module diff --git a/modules/metadata/mod_env.c b/modules/metadata/mod_env.c index abaed0192d..17398686ea 100644 --- a/modules/metadata/mod_env.c +++ b/modules/metadata/mod_env.c @@ -55,14 +55,14 @@ static void *merge_env_dir_configs(apr_pool_t *p, void *basev, void *addv) int i; - /* + /* * res->vars = copy_table( p, base->vars ); * foreach $unsetenv ( @add->unsetenv ) * table_unset( res->vars, $unsetenv ); * foreach $element ( @add->vars ) * table_set( res->vars, $element.key, $element.val ); * - * add->unsetenv already removed the vars from add->vars, + * add->unsetenv already removed the vars from add->vars, * if they preceeded the UnsetEnv directive. */ res->vars = apr_table_copy(p, base->vars); @@ -95,7 +95,7 @@ static const char *add_env_module_vars_passed(cmd_parms *cmd, void *sconf_, env_dir_config_rec *sconf = sconf_; apr_table_t *vars = sconf->vars; const char *env_var; - + env_var = getenv(arg); if (env_var != NULL) { apr_table_setn(vars, arg, apr_pstrdup(cmd->pool, env_var)); @@ -112,7 +112,7 @@ static const char *add_env_module_vars_set(cmd_parms *cmd, void *sconf_, const char *name, const char *value) { env_dir_config_rec *sconf = sconf_; - + /* name is mandatory, value is optional. no value means * set the variable to an empty string */ diff --git a/modules/metadata/mod_expires.c b/modules/metadata/mod_expires.c index 160329750c..f2e91fcf19 100644 --- a/modules/metadata/mod_expires.c +++ b/modules/metadata/mod_expires.c @@ -18,13 +18,13 @@ * mod_expires.c * version 0.0.11 * status beta - * + * * Andrew Wilson 26.Jan.96 * * This module allows you to control the form of the Expires: header * that Apache issues for each access. Directives can appear in * configuration files or in .htaccess files so expiry semantics can - * be defined on a per-directory basis. + * be defined on a per-directory basis. * * DIRECTIVE SYNTAX * @@ -56,7 +56,7 @@ * * Another example, our html pages can change all the time, the gifs * tend not to change often: - * + * * # pages are hot (1 week), images are cold (1 month) * ExpiresByType text/html A604800 * ExpiresByType image/gif A2592000 @@ -85,7 +85,7 @@ * ExpiresByType type/encoding " [plus] { }*" * * where is one of: - * access + * access * now equivalent to 'access' * modification * @@ -134,8 +134,8 @@ * rely on presence of HTTP_TIME_FORMAT in Apache 1.1+. * 21.Feb.96 This version (0.0.9) reverses assumptions made in 0.0.8 * about star/star handlers. Reverting to 0.0.7 behaviour. - * 08.Jun.96 allows ExpiresDefault to be used with responses that use - * the DefaultType by not DECLINING, but instead skipping + * 08.Jun.96 allows ExpiresDefault to be used with responses that use + * the DefaultType by not DECLINING, but instead skipping * the table_get check and then looking for an ExpiresDefault. * [Rob Hartill] * 04.Nov.96 'const' definitions added. @@ -324,7 +324,7 @@ static const char *set_expiresbytype(cmd_parms *cmd, void *in_dir_config, if ((strlen(++check) == 1) && (*check == '*')) { dir_config->wildcards = 1; } - + if ((response = check_code(cmd->pool, code, &real_code)) == NULL) { apr_table_setn(dir_config->expiresbytype, mime, real_code); return NULL; @@ -399,7 +399,7 @@ static int set_expiration_fields(request_rec *r, const char *code, switch (code[0]) { case 'M': - if (r->finfo.filetype == 0) { + if (r->finfo.filetype == 0) { /* file doesn't exist on disk, so we can't do anything based on * modification time. Note that this does _not_ log an error. */ @@ -410,7 +410,7 @@ static int set_expiration_fields(request_rec *r, const char *code, additional = apr_time_from_sec(additional_sec); break; case 'A': - /* there's been some discussion and it's possible that + /* there's been some discussion and it's possible that * 'access time' will be stored in request structure */ base = r->request_time; @@ -418,7 +418,7 @@ static int set_expiration_fields(request_rec *r, const char *code, additional = apr_time_from_sec(additional_sec); break; default: - /* expecting the add_* routines to be case-hardened this + /* expecting the add_* routines to be case-hardened this * is just a reminder that module is beta */ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, @@ -472,7 +472,7 @@ static apr_status_t expires_filter(ap_filter_t *f, * this module. First, check to see if there is an applicable * ExpiresByType directive. */ - expiry = apr_table_get(conf->expiresbytype, + expiry = apr_table_get(conf->expiresbytype, ap_field_noparam(r->pool, r->content_type)); if (expiry == NULL) { int usedefault = 1; @@ -530,7 +530,7 @@ static void expires_insert_filter(request_rec *r) conf = (expires_dir_config *) ap_get_module_config(r->per_dir_config, &expires_module); - /* Check to see if the filter is enabled and if there are any applicable + /* Check to see if the filter is enabled and if there are any applicable * config directives for this directory scope */ if (conf->active != ACTIVE_ON || diff --git a/modules/metadata/mod_headers.c b/modules/metadata/mod_headers.c index cf798d8ff4..ac8c515928 100644 --- a/modules/metadata/mod_headers.c +++ b/modules/metadata/mod_headers.c @@ -43,8 +43,8 @@ * * When the request is processed, the header directives are processed in * this order: firstly, the main server, then the virtual server handling - * this request (if any), then any sections (working downwards - * from the root dir), then an sections (working down from + * this request (if any), then any sections (working downwards + * from the root dir), then an sections (working down from * shortest URL component), the any sections. This order is * important if any 'set' or 'unset' actions are used. For example, * the following two directives have different effect if applied in @@ -100,7 +100,7 @@ static char hdr_out = '1'; /* Header onsuccess */ static char hdr_err = '2'; /* Header always */ /* - * There is an array of struct format_tag per Header/RequestHeader + * There is an array of struct format_tag per Header/RequestHeader * config directive */ typedef struct { @@ -151,8 +151,8 @@ static const char *constant_item(request_rec *r, char *stuff) } static const char *header_request_duration(request_rec *r, char *a) { - return apr_psprintf(r->pool, "D=%" APR_TIME_T_FMT, - (apr_time_now() - r->request_time)); + return apr_psprintf(r->pool, "D=%" APR_TIME_T_FMT, + (apr_time_now() - r->request_time)); } static const char *header_request_time(request_rec *r, char *a) { @@ -165,9 +165,9 @@ static const char *unwrap_header(apr_pool_t *p, const char *hdr) { if (ap_strchr_c(hdr, APR_ASCII_LF) || ap_strchr_c(hdr, APR_ASCII_CR)) { char *ptr; - + hdr = ptr = apr_pstrdup(p, hdr); - + do { if (*ptr == APR_ASCII_LF || *ptr == APR_ASCII_CR) *ptr = APR_ASCII_BLANK; @@ -189,7 +189,7 @@ static const char *header_request_env_var(request_rec *r, char *a) static const char *header_request_ssl_var(request_rec *r, char *name) { if (header_ssl_lookup) { - const char *val = header_ssl_lookup(r->pool, r->server, + const char *val = header_ssl_lookup(r->pool, r->server, r->connection, r, name); if (val && val[0]) return unwrap_header(r->pool, val); @@ -231,7 +231,7 @@ static void *merge_headers_config(apr_pool_t *p, void *basev, void *overridesv) return newconf; } - + static char *parse_misc_string(apr_pool_t *p, format_tag *tag, const char **sa) { const char *s; @@ -270,7 +270,7 @@ static char *parse_misc_string(apr_pool_t *p, format_tag *tag, const char **sa) *d++ = '\n'; s++; break; - case 't': + case 't': *d++ = '\t'; s++; break; @@ -293,7 +293,7 @@ static char *parse_misc_string(apr_pool_t *p, format_tag *tag, const char **sa) } static char *parse_format_tag(apr_pool_t *p, format_tag *tag, const char **sa) -{ +{ const char *s = *sa; const char * (*tag_handler)(request_rec *,char *); @@ -333,13 +333,13 @@ static char *parse_format_tag(apr_pool_t *p, format_tag *tag, const char **sa) } /* - * A format string consists of white space, text and optional format - * tags in any order. E.g., + * A format string consists of white space, text and optional format + * tags in any order. E.g., * * Header add MyHeader "Free form text %D %t more text" * * Decompose the format string into its tags. Each tag (struct format_tag) - * contains a pointer to the function used to format the tag. Then save each + * contains a pointer to the function used to format the tag. Then save each * tag in the tag array anchored in the header_entry. */ static char *parse_format_string(apr_pool_t *p, header_entry *hdr, const char *s) @@ -446,7 +446,7 @@ static APR_INLINE const char *header_inout_cmd(cmd_parms *cmd, condition_var = envclause + 4; } } - + if ((colon = ap_strchr_c(hdr, ':'))) { hdr = apr_pstrmemdup(cmd->pool, hdr, colon-hdr); } @@ -489,23 +489,23 @@ static const char *header_cmd(cmd_parms *cmd, void *indirconf, } /* - * Process the tags in the format string. Tags may be format specifiers + * Process the tags in the format string. Tags may be format specifiers * (%D, %t, etc.), whitespace or text strings. For each tag, run the handler * (formatter) specific to the tag. Handlers return text strings. - * Concatenate the return from each handler into one string that is + * Concatenate the return from each handler into one string that is * returned from this call. */ -static char* process_tags(header_entry *hdr, request_rec *r) +static char* process_tags(header_entry *hdr, request_rec *r) { int i; const char *s; char *str = NULL; format_tag *tag = (format_tag*) hdr->ta->elts; - + for (i = 0; i < hdr->ta->nelts; i++) { s = tag[i].func(r, tag[i].arg); - if (str == NULL) + if (str == NULL) str = apr_pstrdup(r->pool, s); else str = apr_pstrcat(r->pool, str, s, NULL); @@ -515,7 +515,7 @@ static char* process_tags(header_entry *hdr, request_rec *r) static int echo_header(echo_do *v, const char *key, const char *val) { - /* If the input header (key) matches the regex, echo it intact to + /* If the input header (key) matches the regex, echo it intact to * r->headers_out. */ if (!ap_regexec(v->hdr->regex, key, 0, NULL, 0)) { @@ -572,7 +572,7 @@ static void do_headers_fixup(request_rec *r, apr_table_t *headers, echo_do v; v.r = r; v.hdr = hdr; - apr_table_do((int (*) (void *, const char *, const char *)) + apr_table_do((int (*) (void *, const char *, const char *)) echo_header, (void *) &v, r->headers_in, NULL); break; } diff --git a/modules/metadata/mod_mime_magic.c b/modules/metadata/mod_mime_magic.c index 6440c4d8de..faaea0ec35 100644 --- a/modules/metadata/mod_mime_magic.c +++ b/modules/metadata/mod_mime_magic.c @@ -229,7 +229,7 @@ static int mget(request_rec *, union VALUETYPE *, unsigned char *, static int mcheck(request_rec *, union VALUETYPE *, struct magic *); static void mprint(request_rec *, union VALUETYPE *, struct magic *); -static int uncompress(request_rec *, int, +static int uncompress(request_rec *, int, unsigned char **, apr_size_t); static long from_oct(int, char *); static int fsmagic(request_rec *r, const char *fn); @@ -885,7 +885,7 @@ static int tryit(request_rec *r, unsigned char *buf, apr_size_t nb, /* * Try compression stuff */ - if (checkzmagic == 1) { + if (checkzmagic == 1) { if (zmagic(r, buf, nb) == 1) return OK; } @@ -933,8 +933,8 @@ static int apprentice(server_rec *s, apr_pool_t *p) ap_log_error(APLOG_MARK, APLOG_ERR, APR_EBADPATH, s, MODNAME ": Invalid magic file path %s", conf->magicfile); return -1; - } - if ((result = apr_file_open(&f, fname, APR_READ | APR_BUFFERED, + } + if ((result = apr_file_open(&f, fname, APR_READ | APR_BUFFERED, APR_OS_DEFAULT, p) != APR_SUCCESS)) { ap_log_error(APLOG_MARK, APLOG_ERR, result, s, MODNAME ": can't read magic file %s", fname); @@ -957,7 +957,7 @@ static int apprentice(server_rec *s, apr_pool_t *p) *last = '\0'; --last; } - + /* skip leading whitespace */ ws_offset = 0; while (line[ws_offset] && apr_isspace(line[ws_offset])) { @@ -2127,16 +2127,16 @@ static int create_uncompress_child(struct uncompress_parms *parm, apr_pool_t *cn apr_procattr_t *procattr; apr_proc_t *procnew; - /* XXX missing 1.3 logic: + /* XXX missing 1.3 logic: * * what happens when !compr[parm->method].silent? * Should we create the err pipe, read it, and copy to the log? */ - + env = (const char *const *)ap_create_environment(child_context, r->subprocess_env); if ((apr_procattr_create(&procattr, child_context) != APR_SUCCESS) || - (apr_procattr_io_set(procattr, APR_FULL_BLOCK, + (apr_procattr_io_set(procattr, APR_FULL_BLOCK, APR_FULL_BLOCK, APR_NO_PIPE) != APR_SUCCESS) || (apr_procattr_dir_set(procattr, r->filename) != APR_SUCCESS) || (apr_procattr_cmdtype_set(procattr, APR_PROGRAM) != APR_SUCCESS)) { @@ -2169,7 +2169,7 @@ static int create_uncompress_child(struct uncompress_parms *parm, apr_pool_t *cn return (rc); } -static int uncompress(request_rec *r, int method, +static int uncompress(request_rec *r, int method, unsigned char **newch, apr_size_t n) { struct uncompress_parms parm; @@ -2341,7 +2341,7 @@ static int revision_suffix(request_rec *r) apr_pstrdup(r->pool, sub->content_encoding); if (sub->content_languages) { int n; - r->content_languages = apr_array_copy(r->pool, + r->content_languages = apr_array_copy(r->pool, sub->content_languages); for (n = 0; n < r->content_languages->nelts; ++n) { char **lang = ((char **)r->content_languages->elts) + n; diff --git a/modules/metadata/mod_setenvif.c b/modules/metadata/mod_setenvif.c index bd0ccfb747..c28fc1c021 100644 --- a/modules/metadata/mod_setenvif.c +++ b/modules/metadata/mod_setenvif.c @@ -18,7 +18,7 @@ * mod_setenvif.c * Set environment variables based on matching request headers or * attributes against regex strings - * + * * Paul Sutton 27 Oct 1996 * Based on mod_browser by Alexei Kosut */ @@ -34,12 +34,12 @@ * * where name is either a HTTP request header name, or one of the * special values (see below). 'name' may be a regex when it is used - * to specify an HTTP request header name. The 'value' of the header + * to specify an HTTP request header name. The 'value' of the header & (or the value of the special value from below) are compared against * the regex argument. If this is a simple string, a simple sub-string * match is performed. Otherwise, a request expression match is * done. If the value matches the string or regular expression, the - * environment variables listed as var ... are set. Each var can + * environment variables listed as var ... are set. Each var can * be in one of three formats: var, which sets the named variable * (the value value "1"); var=value, which sets the variable to * the given value; or !var, which unsets the variable is it has @@ -169,7 +169,7 @@ static void *merge_setenvif_config(apr_pool_t *p, void *basev, void *overridesv) #define ICASE_MAGIC ((void *)(&setenvif_module)) #define SEI_MAGIC_HEIRLOOM "setenvif-phase-flag" -static int is_header_regex(apr_pool_t *p, const char* name) +static int is_header_regex(apr_pool_t *p, const char* name) { /* If a Header name contains characters other than: * -,_,[A-Z\, [a-z] and [0-9]. @@ -570,7 +570,7 @@ static int match_headers(request_rec *r) elts = (const apr_table_entry_t *) arr->elts; val = NULL; for (j = 0; j < arr->nelts; ++j) { - if (!ap_regexec(b->pnamereg, elts[j].key, 0, NULL, 0)) { + if (!ap_regexec(b->pnamereg, elts[j].key, 0, NULL, 0)) { val = elts[j].val; } } diff --git a/modules/metadata/mod_unique_id.c b/modules/metadata/mod_unique_id.c index ebb63ebb21..1185f19147 100644 --- a/modules/metadata/mod_unique_id.c +++ b/modules/metadata/mod_unique_id.c @@ -47,10 +47,10 @@ typedef struct { * cannot guarantee the thread_id will be an integer. * * This code looks like it won't give a unique ID with the new thread logic. - * It will. The reason is, we don't increment the counter in a thread_safe + * It will. The reason is, we don't increment the counter in a thread_safe * manner. Because the thread_index is also in the unique ID now, this does * not matter. In order for the id to not be unique, the same thread would - * have to get the same counter twice in the same second. + * have to get the same counter twice in the same second. */ /* Comments: @@ -123,7 +123,7 @@ static unique_id_rec cur_unique_id; /* * Number of elements in the structure unique_id_rec. */ -#define UNIQUE_ID_REC_MAX 5 +#define UNIQUE_ID_REC_MAX 5 static unsigned short unique_id_rec_offset[UNIQUE_ID_REC_MAX], unique_id_rec_size[UNIQUE_ID_REC_MAX], @@ -199,12 +199,12 @@ static int unique_id_global_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *pt * If the server is pummelled with restart requests we could possibly end * up in a situation where we're starting again during the same second * that has been used in previous identifiers. Avoid that situation. - * + * * In truth, for this to actually happen not only would it have to restart * in the same second, but it would have to somehow get the same pids as * one of the other servers that was running in that second. Which would * mean a 64k wraparound on pids ... not very likely at all. - * + * * But protecting against it is relatively cheap. We just sleep into the * next second. */ @@ -222,7 +222,7 @@ static void unique_id_child_init(apr_pool_t *p, server_rec *s) * physical machine there are multiple servers (i.e. using Listen). But * it's guaranteed that none of them will share the same pids between * children. - * + * * XXX: for multithread this needs to use a pid/tid combo and probably * needs to be expanded to 32 bits */ @@ -299,7 +299,7 @@ static int gen_unique_id(request_rec *r) apr_table_setn(r->subprocess_env, "UNIQUE_ID", e); return DECLINED; } - + new_unique_id.in_addr = cur_unique_id.in_addr; new_unique_id.pid = cur_unique_id.pid; new_unique_id.counter = cur_unique_id.counter; @@ -323,7 +323,7 @@ static int gen_unique_id(request_rec *r) */ x[k++] = '\0'; x[k++] = '\0'; - + /* alloc str and do the uuencoding */ str = (char *)apr_palloc(r->pool, unique_id_rec_size_uu + 1); k = 0; @@ -353,7 +353,7 @@ static void register_hooks(apr_pool_t *p) { ap_hook_post_config(unique_id_global_init, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_child_init(unique_id_child_init, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_post_read_request(gen_unique_id, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_post_read_request(gen_unique_id, NULL, NULL, APR_HOOK_MIDDLE); } module AP_MODULE_DECLARE_DATA unique_id_module = { diff --git a/modules/metadata/mod_usertrack.c b/modules/metadata/mod_usertrack.c index 21840f37d1..a7dd1a21c7 100644 --- a/modules/metadata/mod_usertrack.c +++ b/modules/metadata/mod_usertrack.c @@ -106,7 +106,7 @@ static void make_cookie(request_rec *r) dcfg = ap_get_module_config(r->per_dir_config, &usertrack_module); /* XXX: hmm, this should really tie in with mod_unique_id */ - apr_snprintf(cookiebuf, sizeof(cookiebuf), "%s.%" APR_TIME_T_FMT, rname, + apr_snprintf(cookiebuf, sizeof(cookiebuf), "%s.%" APR_TIME_T_FMT, rname, apr_time_now()); if (cls->expires) { @@ -117,7 +117,7 @@ static void make_cookie(request_rec *r) if ((dcfg->style == CT_UNSET) || (dcfg->style == CT_NETSCAPE)) { apr_time_exp_t tms; - apr_time_exp_gmt(&tms, r->request_time + apr_time_exp_gmt(&tms, r->request_time + apr_time_from_sec(cls->expires)); new_cookie = apr_psprintf(r->pool, "%s; expires=%s, " @@ -295,7 +295,7 @@ static const char *set_cookie_exp(cmd_parms *parms, void *dummy, } /* - * The harder case - stolen from mod_expires + * The harder case - stolen from mod_expires * * CookieExpires "[plus] { }*" */ diff --git a/modules/metadata/mod_version.c b/modules/metadata/mod_version.c index 47b938a73b..203c12f55f 100644 --- a/modules/metadata/mod_version.c +++ b/modules/metadata/mod_version.c @@ -17,7 +17,7 @@ /* * mod_version.c * Allow conditional configuration depending on the httpd version - * + * * André Malo (nd/perlig.de), January 2004 * * Some stuff coded here is heavily based on the core @@ -163,7 +163,7 @@ static int match_version(apr_pool_t *pool, char *version_string, rc = !ap_regexec(compiled, to_match, 0, NULL, 0); ap_pregfree(pool, compiled); - return rc; + return rc; } /* diff --git a/modules/proxy/ajp_header.c b/modules/proxy/ajp_header.c index a72183a415..002b5b3bb8 100644 --- a/modules/proxy/ajp_header.c +++ b/modules/proxy/ajp_header.c @@ -18,20 +18,20 @@ #include "ajp.h" static const char *response_trans_headers[] = { - "Content-Type", - "Content-Language", - "Content-Length", - "Date", - "Last-Modified", - "Location", - "Set-Cookie", - "Set-Cookie2", - "Servlet-Engine", - "Status", + "Content-Type", + "Content-Language", + "Content-Length", + "Date", + "Last-Modified", + "Location", + "Set-Cookie", + "Set-Cookie2", + "Servlet-Engine", + "Status", "WWW-Authenticate" }; -static const char *long_res_header_for_sc(int sc) +static const char *long_res_header_for_sc(int sc) { const char *rc = NULL; sc = sc & 0X00FF; @@ -56,7 +56,7 @@ static int sc_for_req_header(const char *header_name) */ if (len < 4 || len > 15) return UNKNOWN_METHOD; - + while (*p) header[i++] = apr_toupper(*p++); header[i] = '\0'; @@ -158,7 +158,7 @@ static const unsigned char sc_for_req_method_table[] = { SC_M_MKWORKSPACE, SC_M_MKACTIVITY, SC_M_BASELINE_CONTROL, - SC_M_MERGE, + SC_M_MERGE, 0 /* M_INVALID */ }; @@ -218,7 +218,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg, ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "Into ajp_marshal_into_msgb"); - if ((method = sc_for_req_method_by_id(r->method_number)) == UNKNOWN_METHOD) { + if ((method = sc_for_req_method_by_id(r->method_number)) == UNKNOWN_METHOD) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "ajp_marshal_into_msgb - No such method %s", r->method); @@ -274,7 +274,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg, return AJP_EOVERFLOW; } } - + if (ajp_msg_append_string(msg, elts[i].val)) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "ajp_marshal_into_msgb: " @@ -297,7 +297,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg, } } */ - + if (r->user) { if (ajp_msg_append_uint8(msg, SC_A_REMOTE_USER) || ajp_msg_append_string(msg, r->user)) { @@ -337,7 +337,7 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg, } /* XXX: Is the subprocess_env a right place? * - * ProxyPass ajp://remote:8009/servlets-examples + * ProxyPass ajp://remote:8009/servlets-examples * SetEnv SSL_SESSION_ID CUSTOM_SSL_SESSION_ID * */ @@ -436,10 +436,10 @@ AJPV13_RESPONSE/AJPV14_RESPONSE:= *body_chunk terminator boolean -req_header_name := +req_header_name := sc_req_header_name | (string) -res_header_name := +res_header_name := sc_res_header_name | (string) header_value := @@ -504,7 +504,7 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg, if (rc != APR_SUCCESS) { return rc; } - + if ((name & 0XFF00) == 0XA000) { ajp_msg_peek_uint16(msg, &name); stringname = long_res_header_for_sc(name); @@ -555,7 +555,7 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg, ap_xlate_proto_from_ascii(value, strlen(value)); #endif ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, - "ajp_unmarshal_response: Header[%d] [%s] = [%s]", + "ajp_unmarshal_response: Header[%d] [%s] = [%s]", i, stringname, value); apr_table_add(r->headers_out, stringname, value); @@ -589,7 +589,7 @@ apr_status_t ajp_send_header(apr_socket_t *sock, return rc; } - rc = ajp_marshal_into_msgb(msg, r, uri); + rc = ajp_marshal_into_msgb(msg, r, uri); if (rc != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "ajp_send_header: ajp_marshal_into_msgb failed"); @@ -615,7 +615,7 @@ apr_status_t ajp_read_header(apr_socket_t *sock, { apr_byte_t result; apr_status_t rc; - + if (*msg) { rc = ajp_msg_reuse(*msg); if (rc != APR_SUCCESS) { diff --git a/modules/proxy/ajp_link.c b/modules/proxy/ajp_link.c index 8a735060f5..e5cd2c16eb 100644 --- a/modules/proxy/ajp_link.c +++ b/modules/proxy/ajp_link.c @@ -28,9 +28,9 @@ apr_status_t ajp_ilink_send(apr_socket_t *sock, ajp_msg_t *msg) "ajp_ilink_send(): NULL socket provided"); return AJP_EINVAL; } - + ajp_msg_end(msg); - + length = msg->len; buf = (char *)msg->buf; @@ -68,7 +68,7 @@ static apr_status_t ilink_read(apr_socket_t *sock, apr_byte_t *buf, continue; else if (status != APR_SUCCESS) return status; /* any error. */ - + rdlen += length; length = len - rdlen; } @@ -89,15 +89,15 @@ apr_status_t ajp_ilink_receive(apr_socket_t *sock, ajp_msg_t *msg) } hlen = msg->header_len; - + status = ilink_read(sock, msg->buf, hlen); - + if (status != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, status, NULL, "ajp_ilink_receive() can't receive header"); return AJP_ENO_HEADER; } - + status = ajp_msg_check_header(msg, &blen); if (status != APR_SUCCESS) { diff --git a/modules/proxy/ajp_msg.c b/modules/proxy/ajp_msg.c index 21bda25241..53988bc7e7 100644 --- a/modules/proxy/ajp_msg.c +++ b/modules/proxy/ajp_msg.c @@ -42,7 +42,7 @@ char * ajp_msg_dump(apr_pool_t *pool, ajp_msg_t *msg, char *err) len = 1024; rv = apr_palloc(pool, bl); apr_snprintf(rv, bl, - "ajp_msg_dump(): %s pos=%" APR_SIZE_T_FMT + "ajp_msg_dump(): %s pos=%" APR_SIZE_T_FMT " len=%" APR_SIZE_T_FMT " max=%d\n", err, msg->pos, msg->len, AJP_MSG_BUFFER_SZ); bl -= strlen(rv); @@ -79,7 +79,7 @@ char * ajp_msg_dump(apr_pool_t *pool, ajp_msg_t *msg, char *err) p = rv + strlen(rv); } - + return rv; } @@ -120,7 +120,7 @@ apr_status_t ajp_msg_check_header(ajp_msg_t *msg, apr_size_t *len) msg->len = msglen + AJP_HEADER_LEN; msg->pos = AJP_HEADER_LEN; *len = msglen; - + return APR_SUCCESS; } @@ -134,7 +134,7 @@ apr_status_t ajp_msg_reset(ajp_msg_t *msg) { msg->len = AJP_HEADER_LEN; msg->pos = AJP_HEADER_LEN; - + return APR_SUCCESS; } @@ -177,14 +177,14 @@ apr_status_t ajp_msg_end(ajp_msg_t *msg) msg->buf[2] = (apr_byte_t)((len >> 8) & 0xFF); msg->buf[3] = (apr_byte_t)(len & 0xFF); - + return APR_SUCCESS; } static APR_INLINE int ajp_log_overflow(ajp_msg_t *msg, const char *context) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, - "%s(): BufferOverflowException %" APR_SIZE_T_FMT + "%s(): BufferOverflowException %" APR_SIZE_T_FMT " %" APR_SIZE_T_FMT, context, msg->pos, msg->len); return AJP_EOVERFLOW; @@ -260,8 +260,8 @@ apr_status_t ajp_msg_append_uint8(ajp_msg_t *msg, apr_byte_t value) } /** - * Add a String in AJP message, and transform the String in ASCII - * if convert is set and we're on an EBCDIC machine + * Add a String in AJP message, and transform the String in ASCII + * if convert is set and we're on an EBCDIC machine * * @param msg AJP Message to get value from * @param value Pointer to String @@ -341,7 +341,7 @@ apr_status_t ajp_msg_get_uint32(ajp_msg_t *msg, apr_uint32_t *rvalue) value |= ((msg->buf[(msg->pos++)] & 0xFF) << 16); value |= ((msg->buf[(msg->pos++)] & 0xFF) << 8); value |= ((msg->buf[(msg->pos++)] & 0xFF)); - + *rvalue = value; return APR_SUCCESS; } @@ -357,7 +357,7 @@ apr_status_t ajp_msg_get_uint32(ajp_msg_t *msg, apr_uint32_t *rvalue) apr_status_t ajp_msg_get_uint16(ajp_msg_t *msg, apr_uint16_t *rvalue) { apr_uint16_t value; - + if ((msg->pos + 1) > msg->len) { return ajp_log_overflow(msg, "ajp_msg_get_uint16"); } @@ -384,10 +384,10 @@ apr_status_t ajp_msg_peek_uint16(ajp_msg_t *msg, apr_uint16_t *rvalue) if ((msg->pos + 1) > msg->len) { return ajp_log_overflow(msg, "ajp_msg_peek_uint16"); } - + value = ((msg->buf[(msg->pos)] & 0xFF) << 8); value += ((msg->buf[(msg->pos + 1)] & 0xFF)); - + *rvalue = value; return APR_SUCCESS; } @@ -405,7 +405,7 @@ apr_status_t ajp_msg_peek_uint8(ajp_msg_t *msg, apr_byte_t *rvalue) if (msg->pos > msg->len) { return ajp_log_overflow(msg, "ajp_msg_peek_uint8"); } - + *rvalue = msg->buf[msg->pos]; return APR_SUCCESS; } @@ -423,7 +423,7 @@ apr_status_t ajp_msg_get_uint8(ajp_msg_t *msg, apr_byte_t *rvalue) if (msg->pos > msg->len) { return ajp_log_overflow(msg, "ajp_msg_get_uint8"); } - + *rvalue = msg->buf[msg->pos++]; return APR_SUCCESS; } @@ -441,7 +441,7 @@ apr_status_t ajp_msg_get_string(ajp_msg_t *msg, const char **rvalue) apr_uint16_t size; apr_size_t start; apr_status_t status; - + status = ajp_msg_get_uint16(msg, &size); start = msg->pos; @@ -504,11 +504,11 @@ apr_status_t ajp_msg_create(apr_pool_t *pool, ajp_msg_t **rmsg) "ajp_msg_create(): can't allocate AJP message memory"); return APR_ENOPOOL; } - + msg->server_side = 0; msg->buf = (apr_byte_t *)apr_palloc(pool, AJP_MSG_BUFFER_SZ); - + /* XXX: This should never happen * In case if the OS cannont allocate 8K of data * we are in serious trouble @@ -524,7 +524,7 @@ apr_status_t ajp_msg_create(apr_pool_t *pool, ajp_msg_t **rmsg) msg->len = 0; msg->header_len = AJP_HEADER_LEN; *rmsg = msg; - + return APR_SUCCESS; } @@ -542,7 +542,7 @@ apr_status_t ajp_msg_copy(ajp_msg_t *smsg, ajp_msg_t *dmsg) "ajp_msg_copy(): destination msg is null"); return AJP_EINVAL; } - + if (smsg->len > AJP_MSG_BUFFER_SZ) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, "ajp_msg_copy(): destination buffer too " @@ -576,11 +576,11 @@ apr_status_t ajp_msg_serialize_ping(ajp_msg_t *msg) if ((rc = ajp_msg_append_uint8(msg, CMD_AJP13_PING)) != APR_SUCCESS) return rc; - + return APR_SUCCESS; } -/** +/** * Serialize in an AJP Message a CPING command * * +-----------------------+ @@ -597,6 +597,6 @@ apr_status_t ajp_msg_serialize_cping(ajp_msg_t *msg) if ((rc = ajp_msg_append_uint8(msg, CMD_AJP13_CPING)) != APR_SUCCESS) return rc; - + return APR_SUCCESS; } diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 1ee15ba13e..1424fe7429 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -91,7 +91,7 @@ static const char *set_worker_param(apr_pool_t *p, } else if (!strcasecmp(key, "ttl")) { /* Time in seconds that will destroy all the connections - * that exced the smax + * that exced the smax */ ival = atoi(val); if (ival < 1) @@ -166,7 +166,7 @@ static const char *set_worker_param(apr_pool_t *p, else return "KeepAlive must be On|Off"; worker->keepalive_set = 1; - } + } else if (!strcasecmp(key, "route")) { /* Worker route. */ @@ -189,35 +189,35 @@ static const char *set_worker_param(apr_pool_t *p, for (v = val; *v; v++) { if (*v == '+') { mode = 1; - v++; + v++; } else if (*v == '-') { mode = 0; - v++; + v++; } if (*v == 'D' || *v == 'd') { if (mode) worker->status |= PROXY_WORKER_DISABLED; else - worker->status &= ~PROXY_WORKER_DISABLED; + worker->status &= ~PROXY_WORKER_DISABLED; } else if (*v == 'S' || *v == 's') { if (mode) worker->status |= PROXY_WORKER_STOPPED; else - worker->status &= ~PROXY_WORKER_STOPPED; + worker->status &= ~PROXY_WORKER_STOPPED; } else if (*v == 'E' || *v == 'e') { if (mode) worker->status |= PROXY_WORKER_IN_ERROR; else - worker->status &= ~PROXY_WORKER_IN_ERROR; + worker->status &= ~PROXY_WORKER_IN_ERROR; } else { - return "Unknow status parameter option"; + return "Unknow status parameter option"; } } - } + } else { return "unknown Worker parameter"; } @@ -364,7 +364,7 @@ static int proxy_detect(request_rec *r) if (!(r->parsed_uri.hostname && !strcasecmp(r->parsed_uri.scheme, ap_http_scheme(r)) && ap_matches_request_vhost(r, r->parsed_uri.hostname, - (apr_port_t)(r->parsed_uri.port_str ? r->parsed_uri.port + (apr_port_t)(r->parsed_uri.port_str ? r->parsed_uri.port : ap_default_port(r))))) { r->proxyreq = PROXYREQ_PROXY; r->uri = r->unparsed_uri; @@ -432,25 +432,25 @@ static int proxy_walk(request_rec *r) proxy_dir_conf *entry_proxy; int num_sec = sconf->sec_proxy->nelts; /* XXX: shouldn't we use URI here? Canonicalize it first? - * Pass over "proxy:" prefix + * Pass over "proxy:" prefix */ const char *proxyname = r->filename + 6; int j; - for (j = 0; j < num_sec; ++j) + for (j = 0; j < num_sec; ++j) { entry_config = sec_proxy[j]; entry_proxy = ap_get_module_config(entry_config, &proxy_module); /* XXX: What about case insensitive matching ??? * Compare regex, fnmatch or string as appropriate - * If the entry doesn't relate, then continue + * If the entry doesn't relate, then continue */ - if (entry_proxy->r + if (entry_proxy->r ? ap_regexec(entry_proxy->r, proxyname, 0, NULL, 0) : (entry_proxy->p_is_fnmatch ? apr_fnmatch(entry_proxy->p, proxyname, 0) - : strncmp(proxyname, entry_proxy->p, + : strncmp(proxyname, entry_proxy->p, strlen(entry_proxy->p)))) { continue; } @@ -608,14 +608,14 @@ static int proxy_handler(request_rec *r) /* set configured max-forwards */ maxfwd = conf->maxfwd; } - apr_table_set(r->headers_in, "Max-Forwards", + apr_table_set(r->headers_in, "Max-Forwards", apr_psprintf(r->pool, "%ld", (maxfwd > 0) ? maxfwd : 0)); if (r->method_number == M_TRACE) { core_server_config *coreconf = (core_server_config *) ap_get_module_config(sconf, &core_module); - if (coreconf->trace_enable == AP_TRACE_DISABLE) + if (coreconf->trace_enable == AP_TRACE_DISABLE) { /* Allow "error-notes" string to be printed by ap_send_error_response() * Note; this goes nowhere, canned error response need an overhaul. @@ -632,7 +632,7 @@ static int proxy_handler(request_rec *r) * the client a 100 Continue response till the connection has * been established */ - if (coreconf->trace_enable != AP_TRACE_EXTENDED + if (coreconf->trace_enable != AP_TRACE_EXTENDED && (r->read_length || r->read_chunked || r->remaining)) { /* Allow "error-notes" string to be printed by ap_send_error_response() @@ -751,7 +751,7 @@ static int proxy_handler(request_rec *r) } else if (access_status == HTTP_SERVICE_UNAVAILABLE) { /* Recoverable server error. - * We can failover to another worker + * We can failover to another worker * Mark the worker as unusable if member of load balancer */ if (balancer) { @@ -767,7 +767,7 @@ static int proxy_handler(request_rec *r) /* Try again if the worker is unusable and the service is * unavailable. */ - } while (!PROXY_WORKER_IS_USABLE(worker) && + } while (!PROXY_WORKER_IS_USABLE(worker) && max_attempts > attempts++); if (DECLINED == access_status) { @@ -821,16 +821,16 @@ static void * create_proxy_config(apr_pool_t *p, server_rec *s) ps->io_buffer_size_set = 0; ps->maxfwd = DEFAULT_MAX_FORWARDS; ps->maxfwd_set = 0; - ps->error_override = 0; - ps->error_override_set = 0; + ps->error_override = 0; + ps->error_override_set = 0; ps->preserve_host_set = 0; - ps->preserve_host = 0; + ps->preserve_host = 0; ps->timeout = 0; ps->timeout_set = 0; ps->badopt = bad_error; ps->badopt_set = 0; ps->pool = p; - + return ps; } @@ -993,7 +993,7 @@ static const char * const apr_array_header_t *arr; const apr_table_entry_t *elts; int i; - + while (*arg) { word = ap_getword_conf(cmd->pool, &arg); if (!f) @@ -1007,7 +1007,7 @@ static const char * return "Invalid ProxyPass parameter. Parameter must be " "in the form 'key=value'"; else - return "ProxyPass can not have a path when defined in a location"; + return "ProxyPass can not have a path when defined in a location"; } else *val++ = '\0'; @@ -1023,7 +1023,7 @@ static const char * new->real = apr_pstrdup(cmd->pool, r); if (r[0] == '!' && r[1] == '\0') return NULL; - + arr = apr_table_elts(params); elts = (const apr_table_entry_t *)arr->elts; /* Distinguish the balancer from woker */ @@ -1035,7 +1035,7 @@ static const char * conf, r); if (err) return apr_pstrcat(cmd->temp_pool, "ProxyPass ", err, NULL); - } + } for (i = 0; i < arr->nelts; i++) { const char *err = set_balancer_param(conf, cmd->pool, balancer, elts[i].key, elts[i].val); @@ -1079,7 +1079,7 @@ static const char * } else { if ( r == NULL) return "ProxyPassReverse needs a path when not defined in a location"; - else + else return "ProxyPassReverse can not have a path when defined in a location"; } @@ -1325,7 +1325,7 @@ static const char* psf->timeout_set=1; psf->timeout=apr_time_from_sec(timeout); - return NULL; + return NULL; } static const char* @@ -1348,7 +1348,7 @@ static const char* } psf->viaopt_set = 1; - return NULL; + return NULL; } static const char* @@ -1369,7 +1369,7 @@ static const char* } psf->badopt_set = 1; - return NULL; + return NULL; } static const char* @@ -1390,7 +1390,7 @@ static const char* } psf->proxy_status_set = 1; - return NULL; + return NULL; } static const char *add_member(cmd_parms *cmd, void *dummy, const char *arg) @@ -1407,7 +1407,7 @@ static const char *add_member(cmd_parms *cmd, void *dummy, const char *arg) const apr_array_header_t *arr; const apr_table_entry_t *elts; int i; - + if (cmd->path) path = apr_pstrdup(cmd->pool, cmd->path); while (*arg) { @@ -1433,7 +1433,7 @@ static const char *add_member(cmd_parms *cmd, void *dummy, const char *arg) return "BalancerMember must define balancer name when outside section"; if (!name) return "BalancerMember must define remote proxy server"; - + ap_str_tolower(path); /* lowercase scheme://hostname */ /* Try to find existing worker */ @@ -1441,10 +1441,10 @@ static const char *add_member(cmd_parms *cmd, void *dummy, const char *arg) if (!worker) { const char *err; if ((err = ap_proxy_add_worker(&worker, cmd->pool, conf, name)) != NULL) - return apr_pstrcat(cmd->temp_pool, "BalancerMember ", err, NULL); + return apr_pstrcat(cmd->temp_pool, "BalancerMember ", err, NULL); } PROXY_COPY_CONF_PARAMS(worker, conf); - + arr = apr_table_elts(params); elts = (const apr_table_entry_t *)arr->elts; for (i = 0; i < arr->nelts; i++) { @@ -1454,7 +1454,7 @@ static const char *add_member(cmd_parms *cmd, void *dummy, const char *arg) return apr_pstrcat(cmd->temp_pool, "BalancerMember ", err, NULL); } /* Try to find the balancer */ - balancer = ap_proxy_get_balancer(cmd->temp_pool, conf, path); + balancer = ap_proxy_get_balancer(cmd->temp_pool, conf, path); if (!balancer) { const char *err = ap_proxy_add_balancer(&balancer, cmd->pool, @@ -1496,13 +1496,13 @@ static const char * */ name = ap_getword_conf(cmd->temp_pool, &arg); } - + if (strncasecmp(name, "balancer:", 9) == 0) { balancer = ap_proxy_get_balancer(cmd->pool, conf, name); if (!balancer) { return apr_pstrcat(cmd->temp_pool, "ProxySet can not find '", name, "' Balancer.", NULL); - } + } } else { worker = ap_proxy_get_worker(cmd->temp_pool, conf, name); @@ -1538,7 +1538,7 @@ static void ap_add_per_proxy_conf(server_rec *s, ap_conf_vector_t *dir_config) proxy_server_conf *sconf = ap_get_module_config(s->module_config, &proxy_module); void **new_space = (void **)apr_array_push(sconf->sec_proxy); - + *new_space = dir_config; } @@ -1579,7 +1579,7 @@ static const char *proxysection(cmd_parms *cmd, void *mconfig, const char *arg) if (!strncasecmp(cmd->path, "proxy:", 6)) cmd->path += 6; - /* XXX Ignore case? What if we proxy a case-insensitive server?!? + /* XXX Ignore case? What if we proxy a case-insensitive server?!? * While we are at it, shouldn't we also canonicalize the entire * scheme? See proxy_fixup() */ @@ -1628,7 +1628,7 @@ static const char *proxysection(cmd_parms *cmd, void *mconfig, const char *arg) static const command_rec proxy_cmds[] = { - AP_INIT_RAW_ARGS("name, "\n\n", NULL); ap_rputs("\n\n" "" - "\n", r); + "\n", r); ap_rvputs(r, "", apr_time_sec(balancer->timeout)); @@ -1827,7 +1827,7 @@ static int proxy_status_hook(request_rec *r, int flags) static void child_init(apr_pool_t *p, server_rec *s) { proxy_worker *reverse = NULL; - + while (s) { void *sconf = s->module_config; proxy_server_conf *conf; @@ -1835,7 +1835,7 @@ static void child_init(apr_pool_t *p, server_rec *s) int i; conf = (proxy_server_conf *)ap_get_module_config(sconf, &proxy_module); - /* Initialize worker's shared scoreboard data */ + /* Initialize worker's shared scoreboard data */ worker = (proxy_worker *)conf->workers->elts; for (i = 0; i < conf->workers->nelts; i++) { ap_proxy_initialize_worker_share(conf, worker, s); @@ -1848,7 +1848,7 @@ static void child_init(apr_pool_t *p, server_rec *s) ap_proxy_initialize_worker(conf->forward, s); /* Do not disable worker in case of errors */ conf->forward->s->status |= PROXY_WORKER_IGNORE_ERRORS; - /* Disable address cache for generic forward worker */ + /* Disable address cache for generic forward worker */ conf->forward->is_address_reusable = 0; } if (!reverse) { @@ -1860,7 +1860,7 @@ static void child_init(apr_pool_t *p, server_rec *s) ap_proxy_initialize_worker(reverse, s); /* Do not disable worker in case of errors */ reverse->s->status |= PROXY_WORKER_IGNORE_ERRORS; - /* Disable address cache for generic reverse worker */ + /* Disable address cache for generic reverse worker */ reverse->is_address_reusable = 0; } conf->reverse = reverse; @@ -1877,7 +1877,7 @@ static int proxy_pre_config(apr_pool_t *pconf, apr_pool_t *plog, { APR_OPTIONAL_HOOK(ap, status_hook, proxy_status_hook, NULL, NULL, APR_HOOK_MIDDLE); - /* Reset workers count on gracefull restart */ + /* Reset workers count on gracefull restart */ proxy_lb_workers = 0; return OK; } @@ -1893,7 +1893,7 @@ static void register_hooks(apr_pool_t *p) * initializes. */ static const char *const aszPred[] = { "mpm_winnt.c", NULL}; - + APR_REGISTER_OPTIONAL_FN(ap_proxy_lb_workers); /* handler */ ap_hook_handler(proxy_handler, NULL, NULL, APR_HOOK_FIRST); @@ -1906,11 +1906,11 @@ static void register_hooks(apr_pool_t *p) /* post read_request handling */ ap_hook_post_read_request(proxy_detect, NULL, NULL, APR_HOOK_FIRST); /* pre config handling */ - ap_hook_pre_config(proxy_pre_config, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_pre_config(proxy_pre_config, NULL, NULL, APR_HOOK_MIDDLE); /* post config handling */ ap_hook_post_config(proxy_post_config, NULL, NULL, APR_HOOK_MIDDLE); /* child init handling */ - ap_hook_child_init(child_init, aszPred, NULL, APR_HOOK_MIDDLE); + ap_hook_child_init(child_init, aszPred, NULL, APR_HOOK_MIDDLE); } @@ -1933,19 +1933,19 @@ APR_HOOK_STRUCT( APR_HOOK_LINK(request_status) ) -APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(proxy, PROXY, int, scheme_handler, +APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(proxy, PROXY, int, scheme_handler, (request_rec *r, proxy_worker *worker, - proxy_server_conf *conf, - char *url, const char *proxyhost, + proxy_server_conf *conf, + char *url, const char *proxyhost, apr_port_t proxyport),(r,worker,conf, url,proxyhost,proxyport),DECLINED) -APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(proxy, PROXY, int, canon_handler, +APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(proxy, PROXY, int, canon_handler, (request_rec *r, char *url),(r, url),DECLINED) APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(proxy, PROXY, int, pre_request, ( proxy_worker **worker, proxy_balancer **balancer, - request_rec *r, + request_rec *r, proxy_server_conf *conf, char **url),(worker,balancer, r,conf,url),DECLINED) @@ -1959,6 +1959,6 @@ APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(proxy, PROXY, int, fixups, (request_rec *r), (r), OK, DECLINED) APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(proxy, PROXY, int, request_status, - (int *status, request_rec *r), + (int *status, request_rec *r), (status, r), OK, DECLINED) diff --git a/modules/proxy/mod_proxy_ajp.c b/modules/proxy/mod_proxy_ajp.c index afee93eafb..22e7cefcd7 100644 --- a/modules/proxy/mod_proxy_ajp.c +++ b/modules/proxy/mod_proxy_ajp.c @@ -198,7 +198,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, /* Try to send something */ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, - "proxy: data to read (max %" APR_SIZE_T_FMT + "proxy: data to read (max %" APR_SIZE_T_FMT " at %" APR_SIZE_T_FMT ")", bufsiz, msg->pos); status = apr_brigade_flatten(input_brigade, buff, &bufsiz); diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c index 0862854b7b..988508adf3 100644 --- a/modules/proxy/mod_proxy_balancer.c +++ b/modules/proxy/mod_proxy_balancer.c @@ -33,7 +33,7 @@ static int proxy_balancer_canon(request_rec *r, char *url) if (strncasecmp(url, "balancer:", 9) == 0) { url += 9; - } + } else { return DECLINED; } @@ -78,7 +78,7 @@ static int init_balancer_members(proxy_server_conf *conf, server_rec *s, proxy_balancer *balancer) { int i; - proxy_worker *workers; + proxy_worker *workers; workers = (proxy_worker *)balancer->workers->elts; @@ -111,7 +111,7 @@ static char *get_path_param(apr_pool_t *pool, char *url, const char *name) { char *path = NULL; - + for (path = strstr(url, name); path; path = strstr(path + 1, name)) { path += (strlen(name) + 1); if (*path == '=') { @@ -137,13 +137,13 @@ static char *get_cookie_param(request_rec *r, const char *name) const char *start_cookie; if ((cookies = apr_table_get(r->headers_in, "Cookie"))) { - for (start_cookie = ap_strstr_c(cookies, name); start_cookie; + for (start_cookie = ap_strstr_c(cookies, name); start_cookie; start_cookie = ap_strstr_c(start_cookie + 1, name)) { if (start_cookie == cookies || start_cookie[-1] == ';' || start_cookie[-1] == ',' || isspace(start_cookie[-1])) { - + start_cookie += strlen(name); while(*start_cookie && isspace(*start_cookie)) ++start_cookie; @@ -161,7 +161,7 @@ static char *get_cookie_param(request_rec *r, const char *name) return cookie; } } - } + } } return NULL; } @@ -235,13 +235,13 @@ static proxy_worker *find_best_worker(proxy_balancer *balancer, request_rec *r) { proxy_worker *candidate = NULL; - + if (PROXY_THREAD_LOCK(balancer) != APR_SUCCESS) - return NULL; + return NULL; candidate = (*balancer->lbmethod->finder)(balancer, r); -/* +/* PROXY_THREAD_UNLOCK(balancer); return NULL; */ @@ -258,10 +258,10 @@ static proxy_worker *find_best_worker(proxy_balancer *balancer, */ #if APR_HAS_THREADS if (balancer->timeout) { - /* XXX: This can perhaps be build using some + /* XXX: This can perhaps be build using some * smarter mechanism, like tread_cond. - * But since the statuses can came from - * different childs, use the provided algo. + * But since the statuses can came from + * different childs, use the provided algo. */ apr_interval_time_t timeout = balancer->timeout; apr_interval_time_t step, tval = 0; @@ -290,7 +290,7 @@ static int rewrite_url(request_rec *r, proxy_worker *worker, { const char *scheme = strstr(*url, "://"); const char *path = NULL; - + if (scheme) path = ap_strchr_c(scheme + 3, '/'); @@ -302,7 +302,7 @@ static int rewrite_url(request_rec *r, proxy_worker *worker, } *url = apr_pstrcat(r->pool, worker->name, path, NULL); - + return OK; } @@ -317,7 +317,7 @@ static int proxy_balancer_pre_request(proxy_worker **worker, apr_status_t rv; *worker = NULL; - /* Step 1: check if the url is for us + /* Step 1: check if the url is for us * The url we can handle starts with 'balancer://' * If balancer is already provided skip the search * for balancer, because this is failover attempt. @@ -325,9 +325,9 @@ static int proxy_balancer_pre_request(proxy_worker **worker, if (!*balancer && !(*balancer = ap_proxy_get_balancer(r->pool, conf, *url))) return DECLINED; - + /* Step 2: find the session route */ - + runtime = find_session_route(*balancer, r, &route, url); /* Lock the LoadBalancer * XXX: perhaps we need the process lock here @@ -341,7 +341,7 @@ static int proxy_balancer_pre_request(proxy_worker **worker, int i, total_factor = 0; proxy_worker *workers; /* We have a sticky load balancer - * Update the workers status + * Update the workers status * so that even session routes get * into account. */ @@ -376,7 +376,7 @@ static int proxy_balancer_pre_request(proxy_worker **worker, ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "proxy: BALANCER: (%s). All workers are in error state", (*balancer)->name); - + return HTTP_SERVICE_UNAVAILABLE; } *worker = runtime; @@ -398,7 +398,7 @@ static int proxy_balancer_pre_request(proxy_worker **worker, (*balancer)->name, (*worker)->name, *url); return access_status; -} +} static int proxy_balancer_post_request(proxy_worker *worker, proxy_balancer *balancer, @@ -420,17 +420,17 @@ static int proxy_balancer_post_request(proxy_worker *worker, * track on that. */ - PROXY_THREAD_UNLOCK(balancer); + PROXY_THREAD_UNLOCK(balancer); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy_balancer_post_request for (%s)", balancer->name); return OK; -} +} static void recalc_factors(proxy_balancer *balancer) { int i; - proxy_worker *workers; + proxy_worker *workers; /* Recalculate lbfactors */ @@ -448,7 +448,7 @@ static void recalc_factors(proxy_balancer *balancer) } } -/* Manages the loadfactors and member status +/* Manages the loadfactors and member status */ static int balancer_handler(request_rec *r) { @@ -580,9 +580,9 @@ static int balancer_handler(request_rec *r) for (n = 0; n < balancer->workers->nelts; n++) { ap_rputs(" \n", r); ap_rvputs(r, " ", worker->scheme, - "\n", NULL); + "\n", NULL); ap_rvputs(r, " ", worker->hostname, - "\n", NULL); + "\n", NULL); ap_rprintf(r, " %d\n", worker->s->lbfactor); ap_rputs(" \n", r); @@ -593,7 +593,7 @@ static int balancer_handler(request_rec *r) ++balancer; } ap_rputs(" \n", r); - ap_rputs("", r); + ap_rputs("", r); } else { ap_set_content_type(r, "text/html"); @@ -611,11 +611,11 @@ static int balancer_handler(request_rec *r) ap_rputs("
    \n

    LoadBalancer Status for ", r); ap_rvputs(r, "uri, "?b=", balancer->name + sizeof("balancer://") - 1, - "\">", NULL); + "\">", NULL); ap_rvputs(r, balancer->name, "

    \n\n", NULL); ap_rputs("\n\n
    SSesTimeoutMethod
    ", balancer->sticky, NULL); ap_rprintf(r, "%" APR_TIME_T_FMT "
    " "" - "\n", r); + "\n", r); ap_rvputs(r, "", apr_time_sec(balancer->timeout)); @@ -635,7 +635,7 @@ static int balancer_handler(request_rec *r) ap_rvputs(r, "\n", NULL); ap_rvputs(r, "
    StickySessionTimeoutFailoverAttemptsMethod
    ", balancer->sticky, NULL); ap_rprintf(r, "%" APR_TIME_T_FMT "
    uri, "?b=", balancer->name + sizeof("balancer://") - 1, "&w=", ap_escape_uri(r->pool, worker->name), - "\">", NULL); + "\">", NULL); ap_rvputs(r, worker->name, "", worker->s->route, NULL); ap_rvputs(r, "", worker->s->redirect, NULL); @@ -660,25 +660,25 @@ static int balancer_handler(request_rec *r) ap_rputs("

    Edit worker settings for ", r); ap_rvputs(r, wsel->name, "

    \n", NULL); ap_rvputs(r, "
    uri, "\">\n
    ", NULL); + ap_rvputs(r, r->uri, "\">\n
    ", NULL); ap_rputs("\n", wsel->s->lbfactor); + ap_rprintf(r, "value=\"%d\">\n", wsel->s->lbfactor); ap_rputs("\n", r); + ap_rvputs(r, "value=\"", wsel->route, NULL); + ap_rputs("\">\n", r); ap_rputs("\n", r); + ap_rvputs(r, "value=\"", wsel->redirect, NULL); + ap_rputs("\">\n", r); ap_rputs("\n", r); + ap_rputs(">\n", r); ap_rputs("\n", r); ap_rvputs(r, "
    Load factor:
    Route:route, NULL); - ap_rputs("\">
    Route Redirect:redirect, NULL); - ap_rputs("\">
    Status:Disabled: s->status & PROXY_WORKER_DISABLED) ap_rputs(" checked", r); ap_rputs("> | Enabled: s->status & PROXY_WORKER_DISABLED)) ap_rputs(" checked", r); - ap_rputs(">
    \npool, wsel->name), "\">\n", NULL); + ap_rvputs(r, "value=\"", ap_escape_uri(r->pool, wsel->name), "\">\n", NULL); ap_rvputs(r, "name + sizeof("balancer://") - 1, "\">\n\n", NULL); @@ -688,7 +688,7 @@ static int balancer_handler(request_rec *r) ap_rputs("

    Edit balancer settings for ", r); ap_rvputs(r, bsel->name, "

    \n", NULL); ap_rvputs(r, "
    uri, "\">\n
    ", NULL); + ap_rvputs(r, r->uri, "\">\n
    ", NULL); ap_rputs("\n", r); ap_rputs("
    StickySession Identifier:sticky) ap_rvputs(r, "value=\"", bsel->sticky, "\"", NULL); @@ -733,8 +733,8 @@ static void child_init(apr_pool_t *p, server_rec *s) proxy_balancer *balancer; int i; conf = (proxy_server_conf *)ap_get_module_config(sconf, &proxy_module); - - /* Initialize shared scoreboard data */ + + /* Initialize shared scoreboard data */ balancer = (proxy_balancer *)conf->balancers->elts; for (i = 0; i < conf->balancers->nelts; i++) { init_balancer_members(conf, s, balancer); @@ -790,7 +790,7 @@ static void child_init(apr_pool_t *p, server_rec *s) * b a d c d a c d b d ... * */ - + static proxy_worker *find_best_byrequests(proxy_balancer *balancer, request_rec *r) { @@ -798,7 +798,7 @@ static proxy_worker *find_best_byrequests(proxy_balancer *balancer, int total_factor = 0; proxy_worker *worker = (proxy_worker *)balancer->workers->elts; proxy_worker *mycandidate = NULL; - + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: Entering byrequests for BALANCER (%s)", @@ -859,7 +859,7 @@ static proxy_worker *find_best_bytraffic(proxy_balancer *balancer, apr_off_t curmin = 0; proxy_worker *worker = (proxy_worker *)balancer->workers->elts; proxy_worker *mycandidate = NULL; - + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: Entering bytraffic for BALANCER (%s)", balancer->name); @@ -887,7 +887,7 @@ static proxy_worker *find_best_bytraffic(proxy_balancer *balancer, } worker++; } - + if (mycandidate) { mycandidate->s->elected++; } @@ -925,8 +925,8 @@ static void ap_proxy_balancer_register_hook(apr_pool_t *p) /* manager handler */ ap_hook_handler(balancer_handler, NULL, NULL, APR_HOOK_FIRST); ap_hook_child_init(child_init, aszPred, NULL, APR_HOOK_MIDDLE); - proxy_hook_pre_request(proxy_balancer_pre_request, NULL, NULL, APR_HOOK_FIRST); - proxy_hook_post_request(proxy_balancer_post_request, NULL, NULL, APR_HOOK_FIRST); + proxy_hook_pre_request(proxy_balancer_pre_request, NULL, NULL, APR_HOOK_FIRST); + proxy_hook_post_request(proxy_balancer_post_request, NULL, NULL, APR_HOOK_FIRST); proxy_hook_canon_handler(proxy_balancer_canon, NULL, NULL, APR_HOOK_FIRST); ap_register_provider(p, PROXY_LBMETHOD, "bytraffic", "0", &bytraffic); ap_register_provider(p, PROXY_LBMETHOD, "byrequests", "0", &byrequests); diff --git a/modules/proxy/mod_proxy_connect.c b/modules/proxy/mod_proxy_connect.c index 4444a3ca76..4238362c06 100644 --- a/modules/proxy/mod_proxy_connect.c +++ b/modules/proxy/mod_proxy_connect.c @@ -23,7 +23,7 @@ module AP_MODULE_DECLARE_DATA proxy_connect_module; -/* +/* * This handles Netscape CONNECT method secure proxy requests. * A connection is opened to the specified host and data is * passed through between the WWW site and the browser. @@ -32,8 +32,8 @@ module AP_MODULE_DECLARE_DATA proxy_connect_module; * "Tunneling SSL Through a WWW Proxy" currently at * http://www.mcom.com/newsref/std/tunneling_ssl.html. * - * If proxyhost and proxyport are set, we send a CONNECT to - * the specified proxy.. + * If proxyhost and proxyport are set, we send a CONNECT to + * the specified proxy.. * * FIXME: this doesn't log the number of bytes sent, but * that may be okay, since the data is supposed to @@ -73,8 +73,8 @@ static int proxy_connect_canon(request_rec *r, char *url) /* CONNECT handler */ static int proxy_connect_handler(request_rec *r, proxy_worker *worker, - proxy_server_conf *conf, - char *url, const char *proxyname, + proxy_server_conf *conf, + char *url, const char *proxyname, apr_port_t proxyport) { apr_pool_t *p = r->pool; @@ -239,7 +239,7 @@ static int proxy_connect_handler(request_rec *r, proxy_worker *worker, ap_xlate_proto_to_ascii(buffer, nbytes); apr_socket_send(client_socket, buffer, &nbytes); #if 0 - /* This is safer code, but it doesn't work yet. I'm leaving it + /* This is safer code, but it doesn't work yet. I'm leaving it * here so that I can fix it later. */ r->status = HTTP_OK; diff --git a/modules/proxy/mod_proxy_ftp.c b/modules/proxy/mod_proxy_ftp.c index 1465827dfc..ef2bb90207 100644 --- a/modules/proxy/mod_proxy_ftp.c +++ b/modules/proxy/mod_proxy_ftp.c @@ -733,7 +733,7 @@ apr_status_t proxy_ftp_cleanup(request_rec *r, proxy_conn_rec *backend) backend->close_on_recycle = 1; ap_set_module_config(r->connection->conn_config, &proxy_ftp_module, NULL); - ap_proxy_release_connection("FTP", backend, r->server); + ap_proxy_release_connection("FTP", backend, r->server); return OK; } @@ -769,7 +769,7 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, char buffer[MAX_STRING_LEN]; char *ftpmessage = NULL; char *path, *strp, *type_suffix, *cwd = NULL; - apr_uri_t uri; + apr_uri_t uri; char *user = NULL; /* char *account = NULL; how to supply an account in a URL? */ const char *password = NULL; @@ -914,8 +914,8 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, connectname, APR_UNSPEC, connectport, 0, address_pool); - if (worker->is_address_reusable && !worker->cp->addr) { - worker->cp->addr = connect_addr; + if (worker->is_address_reusable && !worker->cp->addr) { + worker->cp->addr = connect_addr; PROXY_THREAD_UNLOCK(worker); } /* @@ -945,9 +945,9 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, } return status; } - /* TODO: see if ftp could use determine_connection */ + /* TODO: see if ftp could use determine_connection */ backend->addr = connect_addr; - ap_set_module_config(c->conn_config, &proxy_ftp_module, backend); + ap_set_module_config(c->conn_config, &proxy_ftp_module, backend); } @@ -1221,7 +1221,7 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, } #if !defined (TPF) && !defined(BEOS) - if (conf->recv_buffer_size > 0 + if (conf->recv_buffer_size > 0 && (rv = apr_socket_opt_set(data_sock, APR_SO_RCVBUF, conf->recv_buffer_size))) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, @@ -1309,7 +1309,7 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, } #if !defined (TPF) && !defined(BEOS) - if (conf->recv_buffer_size > 0 + if (conf->recv_buffer_size > 0 && (rv = apr_socket_opt_set(data_sock, APR_SO_RCVBUF, conf->recv_buffer_size))) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, @@ -1355,7 +1355,7 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, local_port = local_addr->port; apr_sockaddr_ip_get(&local_ip, local_addr); - if ((rv = apr_socket_opt_set(local_sock, APR_SO_REUSEADDR, one)) + if ((rv = apr_socket_opt_set(local_sock, APR_SO_REUSEADDR, one)) != APR_SUCCESS) { #ifndef _OSD_POSIX /* BS2000 has this option "always on" */ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, @@ -1478,7 +1478,7 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: FTP: SIZE shows this is a directory"); dirlisting = 1; - rc = proxy_ftp_command(apr_pstrcat(p, "CWD ", + rc = proxy_ftp_command(apr_pstrcat(p, "CWD ", ftp_escape_globbingchars(p, path), CRLF, NULL), r, origin, bb, &ftpmessage); /* possible results: 250, 421, 500, 501, 502, 530, 550 */ @@ -1778,10 +1778,10 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, "proxy: FTP: start body send"); /* read the body, pass it to the output filters */ - while (ap_get_brigade(data->input_filters, - bb, - AP_MODE_READBYTES, - APR_BLOCK_READ, + while (ap_get_brigade(data->input_filters, + bb, + AP_MODE_READBYTES, + APR_BLOCK_READ, conf->io_buffer_size) == APR_SUCCESS) { #if DEBUGGING { diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index 449cb9fe20..8333321780 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -92,7 +92,7 @@ static int proxy_http_canon(request_rec *r, char *url) if (ap_strchr_c(host, ':')) { /* if literal IPv6 address */ host = apr_pstrcat(r->pool, "[", host, "]", NULL); } - r->filename = apr_pstrcat(r->pool, "proxy:", scheme, "://", host, sport, + r->filename = apr_pstrcat(r->pool, "proxy:", scheme, "://", host, sport, "/", path, (search) ? "?" : "", (search) ? search : "", NULL); return OK; } @@ -228,20 +228,20 @@ static apr_status_t stream_reqbody_chunked(apr_pool_t *p, apr_brigade_length(input_brigade, 1, &bytes); hdr_len = apr_snprintf(chunk_hdr, sizeof(chunk_hdr), - "%" APR_UINT64_T_HEX_FMT CRLF, + "%" APR_UINT64_T_HEX_FMT CRLF, (apr_uint64_t)bytes); - + ap_xlate_proto_to_ascii(chunk_hdr, hdr_len); e = apr_bucket_transient_create(chunk_hdr, hdr_len, bucket_alloc); APR_BRIGADE_INSERT_HEAD(input_brigade, e); - + /* * Append the end-of-chunk CRLF */ e = apr_bucket_immortal_create(ASCII_CRLF, 2, bucket_alloc); APR_BRIGADE_INSERT_TAIL(input_brigade, e); - + if (header_brigade) { /* we never sent the header brigade, so go ahead and * take care of that now @@ -267,7 +267,7 @@ static apr_status_t stream_reqbody_chunked(apr_pool_t *p, else { bb = input_brigade; } - + /* The request is flushed below this loop with chunk EOS header */ status = pass_brigade(bucket_alloc, r, p_conn, origin, bb, 0); if (status != APR_SUCCESS) { @@ -388,7 +388,7 @@ static apr_status_t stream_reqbody_cl(apr_pool_t *p, else { bb = input_brigade; } - + /* Once we hit EOS, we are ready to flush. */ status = pass_brigade(bucket_alloc, r, p_conn, origin, bb, seen_eos); if (status != APR_SUCCESS) { @@ -407,7 +407,7 @@ static apr_status_t stream_reqbody_cl(apr_pool_t *p, return status; } } - + if (bytes_streamed != cl_val) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "proxy: client %s given Content-Length did not match" @@ -520,7 +520,7 @@ static apr_status_t spool_reqbody_cl(apr_pool_t *p, } } - + bytes_spooled += bytes; if (seen_eos) { @@ -605,7 +605,7 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r, /* strip connection listed hop-by-hop headers from the request */ /* even though in theory a connection: close coming from the client * should not affect the connection to the server, it's unlikely - * that subsequent client requests will hit this thread/process, + * that subsequent client requests will hit this thread/process, * so we cancel server keepalive if the client does. */ if (ap_proxy_liststr(apr_table_get(r->headers_in, @@ -641,25 +641,25 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r, } else { buf = apr_pstrcat(p, "Host: ", uri->hostname, CRLF, NULL); } - } + } else { - /* don't want to use r->hostname, as the incoming header might have a - * port attached + /* don't want to use r->hostname, as the incoming header might have a + * port attached */ - const char* hostname = apr_table_get(r->headers_in,"Host"); + const char* hostname = apr_table_get(r->headers_in,"Host"); if (!hostname) { hostname = r->server->server_hostname; ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, "proxy: no HTTP 0.9 request (with no host line) " "on incoming request and preserve host set " - "forcing hostname to be %s for uri %s", - hostname, + "forcing hostname to be %s for uri %s", + hostname, r->uri ); } buf = apr_pstrcat(p, "Host: ", hostname, CRLF, NULL); } ap_xlate_proto_to_ascii(buf, strlen(buf)); - e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc); + e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(header_brigade, e); /* handle Via */ @@ -741,7 +741,7 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r, headers_in_array = apr_table_elts(r->headers_in); headers_in = (const apr_table_entry_t *) headers_in_array->elts; for (counter = 0; counter < headers_in_array->nelts; counter++) { - if (headers_in[counter].key == NULL + if (headers_in[counter].key == NULL || headers_in[counter].val == NULL /* Already sent */ @@ -755,7 +755,7 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r, || !strcasecmp(headers_in[counter].key, "Trailer") || !strcasecmp(headers_in[counter].key, "Upgrade") - /* XXX: @@@ FIXME: "Proxy-Authorization" should *only* be + /* XXX: @@@ FIXME: "Proxy-Authorization" should *only* be * suppressed if THIS server requested the authentication, * not when a frontend proxy requested it! * @@ -830,7 +830,7 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r, * that the can and have done so unless they they remove * their decoding from the headers_in T-E list. * XXX: Make this extensible, but in doing so, presume the - * encoding has been done by the extensions' handler, and + * encoding has been done by the extensions' handler, and * do not modify add_te_chunked's logic */ if (old_te_val && strcmp(old_te_val, "chunked") != 0) { @@ -900,7 +900,7 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r, * surrender once we hit 80 bytes less than MAX_MEM_SPOOL * (an arbitrary value.) */ - } while ((bytes_read < MAX_MEM_SPOOL - 80) + } while ((bytes_read < MAX_MEM_SPOOL - 80) && !APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(input_brigade))); /* Use chunked request body encoding or send a content-length body? @@ -909,10 +909,10 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r, * * We have no request body (handled by RB_STREAM_CL) * - * We have a request body length <= MAX_MEM_SPOOL + * We have a request body length <= MAX_MEM_SPOOL * * The administrator has setenv force-proxy-request-1.0 - * + * * The client sent a C-L body, and the administrator has * not setenv proxy-sendchunked or has set setenv proxy-sendcl * @@ -935,12 +935,12 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r, * input to a temporary file. Chunked is always preferable. * * We can only trust the client-provided C-L if the T-E header - * is absent, and the filters are unchanged (the body won't + * is absent, and the filters are unchanged (the body won't * be resized by another content filter). */ if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(input_brigade))) { /* The whole thing fit, so our decision is trivial, use - * the filtered bytes read from the client for the request + * the filtered bytes read from the client for the request * body Content-Length. * * If we expected no body, and read no body, do not set @@ -952,7 +952,7 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r, rb_method = RB_STREAM_CL; } else if (old_te_val) { - if (force10 + if (force10 || (apr_table_get(r->subprocess_env, "proxy-sendcl") && !apr_table_get(r->subprocess_env, "proxy-sendchunks"))) { rb_method = RB_SPOOL_CL; @@ -965,7 +965,7 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r, if (r->input_filters == r->proto_input_filters) { rb_method = RB_STREAM_CL; } - else if (!force10 + else if (!force10 && apr_table_get(r->subprocess_env, "proxy-sendchunks") && !apr_table_get(r->subprocess_env, "proxy-sendcl")) { rb_method = RB_STREAM_CHUNKED; @@ -995,11 +995,11 @@ skip_body: /* send the request body, if any. */ switch(rb_method) { case RB_STREAM_CHUNKED: - status = stream_reqbody_chunked(p, r, p_conn, origin, header_brigade, + status = stream_reqbody_chunked(p, r, p_conn, origin, header_brigade, input_brigade); break; case RB_STREAM_CL: - status = stream_reqbody_cl(p, r, p_conn, origin, header_brigade, + status = stream_reqbody_cl(p, r, p_conn, origin, header_brigade, input_brigade, old_cl_val); break; case RB_SPOOL_CL: @@ -1018,7 +1018,7 @@ skip_body: ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server, "proxy: pass request body failed to %pI (%s)" " from %s (%s)", - p_conn->addr, + p_conn->addr, p_conn->hostname ? p_conn->hostname: "", c->remote_ip, c->remote_host ? c->remote_host: ""); @@ -1265,7 +1265,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, buffer[13] = '\0'; } r->status_line = apr_pstrdup(p, &buffer[9]); - + /* read the headers. */ /* N.B. for HTTP/1.0 clients, we have to fold line-wrapped headers*/ @@ -1312,10 +1312,10 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, /* can't have both Content-Length and Transfer-Encoding */ if (apr_table_get(r->headers_out, "Transfer-Encoding") && apr_table_get(r->headers_out, "Content-Length")) { - /* + /* * 2616 section 4.4, point 3: "if both Transfer-Encoding * and Content-Length are received, the latter MUST be - * ignored"; + * ignored"; * * To help mitigate HTTP Splitting, unset Content-Length * and shut down the backend server connection @@ -1335,7 +1335,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, ap_proxy_clear_connection(p, r->headers_out); if ((buf = apr_table_get(r->headers_out, "Content-Type"))) { ap_set_content_type(r, apr_pstrdup(p, buf)); - } + } ap_proxy_pre_http_request(origin,rp); /* handle Via header in response */ @@ -1442,7 +1442,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: start body send"); - + /* * if we are overriding the errors, we can't put the content * of the page into the brigade @@ -1456,7 +1456,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, apr_off_t readbytes; apr_status_t rv; - rv = ap_get_brigade(rp->input_filters, bb, + rv = ap_get_brigade(rp->input_filters, bb, AP_MODE_READBYTES, mode, conf->io_buffer_size); @@ -1467,7 +1467,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, /* flush to the client and switch to blocking mode */ e = apr_bucket_flush_create(c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, e); - if (ap_pass_brigade(r->output_filters, bb) + if (ap_pass_brigade(r->output_filters, bb) || c->aborted) { backend->close = 1; break; @@ -1486,7 +1486,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, } /* next time try a non-blocking read */ mode = APR_NONBLOCK_READ; - + apr_brigade_length(bb, 0, &readbytes); backend->worker->s->read += readbytes; #if DEBUGGING @@ -1565,7 +1565,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, } return status; } - } else + } else return OK; } @@ -1583,7 +1583,7 @@ apr_status_t ap_proxy_http_cleanup(const char *scheme, request_rec *r, if (backend->close || (r->proto_num < HTTP_VERSION(1,1))) { backend->close_on_recycle = 1; ap_set_module_config(r->connection->conn_config, &proxy_http_module, NULL); - ap_proxy_release_connection(scheme, backend, r->server); + ap_proxy_release_connection(scheme, backend, r->server); } return OK; } @@ -1599,7 +1599,7 @@ apr_status_t ap_proxy_http_cleanup(const char *scheme, request_rec *r, */ static int proxy_http_handler(request_rec *r, proxy_worker *worker, proxy_server_conf *conf, - char *url, const char *proxyname, + char *url, const char *proxyname, apr_port_t proxyport) { int status; @@ -1660,9 +1660,9 @@ static int proxy_http_handler(request_rec *r, proxy_worker *worker, } ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: HTTP: serving URL %s", url); - - - /* only use stored info for top-level pages. Sub requests don't share + + + /* only use stored info for top-level pages. Sub requests don't share * in keepalives */ if (!r->main) { @@ -1705,7 +1705,7 @@ static int proxy_http_handler(request_rec *r, proxy_worker *worker, c, r->server)) != OK) goto cleanup; } - + /* Step Four: Send the Request */ if ((status = ap_proxy_http_request(p, r, backend, backend->connection, conf, uri, url, server_portstr)) != OK) diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 0fb499be5d..96a743eadc 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -38,7 +38,7 @@ static int proxy_match_domainname(struct dirconn_entry *This, request_rec *r); static int proxy_match_hostname(struct dirconn_entry *This, request_rec *r); static int proxy_match_word(struct dirconn_entry *This, request_rec *r); -APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(proxy, PROXY, int, create_req, +APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(proxy, PROXY, int, create_req, (request_rec *r, request_rec *pr), (r, pr), OK, DECLINED) @@ -132,7 +132,7 @@ PROXY_DECLARE(void) ap_proxy_c2hex(int ch, char *x) * Convert a URL-encoded string to canonical form. * It decodes characters which need not be encoded, * and encodes those which must be encoded, and does not touch - * those which must not be touched. + * those which must not be touched. */ PROXY_DECLARE(char *)ap_proxy_canonenc(apr_pool_t *p, const char *x, int len, enum enctype t, int forcedec, int proxyreq) @@ -495,14 +495,14 @@ PROXY_DECLARE(void) ap_proxy_sec2hex(int t, char *y) PROXY_DECLARE(int) ap_proxyerror(request_rec *r, int statuscode, const char *message) { apr_table_setn(r->notes, "error-notes", - apr_pstrcat(r->pool, + apr_pstrcat(r->pool, "The proxy server could not handle the request " "pool, r->uri), "\">", ap_escape_html(r->pool, r->method), - " ", + " ", ap_escape_html(r->pool, r->uri), ".

    \n" "Reason: ", - ap_escape_html(r->pool, message), + ap_escape_html(r->pool, message), "

    ", NULL)); /* Allow "error-notes" string to be printed by ap_send_error_response() */ @@ -698,7 +698,7 @@ static int proxy_match_ipaddr(struct dirconn_entry *This, request_rec *r) != APR_SUCCESS) { #if DEBUGGING ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - "2)IP-NoMatch: hostname=%s msg=Host not found", + "2)IP-NoMatch: hostname=%s msg=Host not found", host); #endif return 0; @@ -711,7 +711,7 @@ static int proxy_match_ipaddr(struct dirconn_entry *This, request_rec *r) if (This->addr.s_addr == (ip->s_addr & This->mask.s_addr)) { #if DEBUGGING ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - "3)IP-Match: %s[%s] <-> ", host, + "3)IP-Match: %s[%s] <-> ", host, inet_ntoa(*ip)); ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "%s/", inet_ntoa(This->addr)); @@ -723,7 +723,7 @@ static int proxy_match_ipaddr(struct dirconn_entry *This, request_rec *r) #if DEBUGGING else { ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, - "3)IP-NoMatch: %s[%s] <-> ", host, + "3)IP-NoMatch: %s[%s] <-> ", host, inet_ntoa(*ip)); ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "%s/", inet_ntoa(This->addr)); @@ -868,7 +868,7 @@ static int proxy_match_word(struct dirconn_entry *This, request_rec *r) } /* checks whether a host in uri_addr matches proxyblock */ -PROXY_DECLARE(int) ap_proxy_checkproxyblock(request_rec *r, proxy_server_conf *conf, +PROXY_DECLARE(int) ap_proxy_checkproxyblock(request_rec *r, proxy_server_conf *conf, apr_sockaddr_t *uri_addr) { int j; @@ -915,7 +915,7 @@ PROXY_DECLARE(int) ap_proxy_pre_http_request(conn_rec *c, request_rec *r) } /* - * converts a series of buckets into a string + * converts a series of buckets into a string * XXX: BillS says this function performs essentially the same function as * ap_rgetline() in protocol.c. Deprecate this function and use ap_rgetline() * instead? I think ap_proxy_string_read() will not work properly on non ASCII @@ -938,7 +938,7 @@ PROXY_DECLARE(apr_status_t) ap_proxy_string_read(conn_rec *c, apr_bucket_brigade /* loop through each brigade */ while (!found) { /* get brigade from network one line at a time */ - if (APR_SUCCESS != (rv = ap_get_brigade(c->input_filters, bb, + if (APR_SUCCESS != (rv = ap_get_brigade(c->input_filters, bb, AP_MODE_GETLINE, APR_BLOCK_READ, 0))) { @@ -1149,7 +1149,7 @@ PROXY_DECLARE(proxy_balancer *) ap_proxy_get_balancer(apr_pool_t *p, char *c, *uri = apr_pstrdup(p, url); int i; - c = strchr(uri, ':'); + c = strchr(uri, ':'); if (c == NULL || c[1] != '/' || c[2] != '/' || c[3] == '\0') return NULL; /* remove path from uri */ @@ -1243,7 +1243,7 @@ PROXY_DECLARE(proxy_worker *) ap_proxy_get_worker(apr_pool_t *p, } else { ap_str_tolower(url_copy); } - + worker = (proxy_worker *)conf->workers->elts; /* @@ -1280,7 +1280,7 @@ static void init_conn_pool(apr_pool_t *p, proxy_worker *worker) proxy_conn_pool *cp; /* - * Create a connection pool's subpool. + * Create a connection pool's subpool. * This pool is used for connection recycling. * Once the worker is added it is never removed but * it can be disabled. @@ -1288,10 +1288,10 @@ static void init_conn_pool(apr_pool_t *p, proxy_worker *worker) apr_pool_create(&pool, p); /* * Alloc from the same pool as worker. - * proxy_conn_pool is permanently attached to the worker. + * proxy_conn_pool is permanently attached to the worker. */ cp = (proxy_conn_pool *)apr_pcalloc(p, sizeof(proxy_conn_pool)); - cp->pool = pool; + cp->pool = pool; worker->cp = cp; } @@ -1345,7 +1345,7 @@ PROXY_DECLARE(proxy_worker *) ap_proxy_create_worker(apr_pool_t *p) return worker; } -PROXY_DECLARE(void) +PROXY_DECLARE(void) ap_proxy_add_worker_to_balancer(apr_pool_t *pool, proxy_balancer *balancer, proxy_worker *worker) { @@ -1562,7 +1562,7 @@ static apr_status_t connection_destructor(void *resource, void *params, { proxy_conn_rec *conn = (proxy_conn_rec *)resource; - /* Destroy the pool only if not called from reslist_destroy */ + /* Destroy the pool only if not called from reslist_destroy */ if (conn->worker->cp->pool) apr_pool_destroy(conn->pool); @@ -1645,7 +1645,7 @@ PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, ser worker->smax = worker->hmax; /* Set min to be lower then smax */ if (worker->min > worker->smax) - worker->min = worker->smax; + worker->min = worker->smax; } else { /* This will supress the apr_reslist creation */ @@ -1813,7 +1813,7 @@ ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, uri->port); /* - * allocate these out of the specified connection pool + * allocate these out of the specified connection pool * The scheme handler decides if this is permanent or * short living pool. */ @@ -1918,7 +1918,7 @@ static int is_socket_connected(apr_socket_t *sock) { apr_size_t buffer_len = 1; - char test_buffer[1]; + char test_buffer[1]; apr_status_t socket_status; apr_interval_time_t current_timeout; @@ -1995,7 +1995,7 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function, } /* Set a keepalive option */ if (worker->keepalive) { - if ((rv = apr_socket_opt_set(newsock, + if ((rv = apr_socket_opt_set(newsock, APR_SO_KEEPALIVE, 1)) != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, "apr_socket_opt_set(SO_KEEPALIVE): Failed to set" @@ -2088,7 +2088,7 @@ PROXY_DECLARE(int) ap_proxy_connection_create(const char *proxy_function, if (!ap_proxy_ssl_enable(conn->connection)) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, "proxy: %s: failed to enable ssl support " - "for %pI (%s)", proxy_function, + "for %pI (%s)", proxy_function, backend_addr, conn->hostname); return HTTP_INTERNAL_SERVER_ERROR; } diff --git a/modules/ssl/mod_ssl.c b/modules/ssl/mod_ssl.c index af91fa5ac2..6602a31b61 100644 --- a/modules/ssl/mod_ssl.c +++ b/modules/ssl/mod_ssl.c @@ -146,7 +146,7 @@ static const command_rec ssl_config_cmds[] = { SSL_CMD_ALL(UserName, TAKE1, "Set user name to SSL variable value") - /* + /* * Proxy configuration for remote SSL connections */ SSL_CMD_SRV(ProxyEngine, FLAG, @@ -197,11 +197,11 @@ static const command_rec ssl_config_cmds[] = { "(arbitrary complex boolean expression - see manual)") /* Deprecated directives. */ - AP_INIT_RAW_ARGS("SSLLog", ap_set_deprecated, NULL, OR_ALL, + AP_INIT_RAW_ARGS("SSLLog", ap_set_deprecated, NULL, OR_ALL, "SSLLog directive is no longer supported - use ErrorLog."), - AP_INIT_RAW_ARGS("SSLLogLevel", ap_set_deprecated, NULL, OR_ALL, + AP_INIT_RAW_ARGS("SSLLogLevel", ap_set_deprecated, NULL, OR_ALL, "SSLLogLevel directive is no longer supported - use LogLevel."), - + AP_END_CMD }; @@ -238,8 +238,8 @@ static apr_status_t ssl_cleanup_pre_config(void *data) * actually load the error strings once per process due to static * variable abuse in OpenSSL. */ - /* - * TODO: determine somewhere we can safely shove out diagnostics + /* + * TODO: determine somewhere we can safely shove out diagnostics * (when enabled) at this late stage in the game: * CRYPTO_mem_leaks_fp(stderr); */ @@ -250,7 +250,7 @@ static int ssl_hook_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp) { - /* We must register the library in full, to ensure our configuration + /* We must register the library in full, to ensure our configuration * code can successfully test the SSL environment. */ CRYPTO_malloc_init(); @@ -480,7 +480,7 @@ static void ssl_hook_Insert_Filter(request_rec *r) static void ssl_register_hooks(apr_pool_t *p) { /* ssl_hook_ReadReq needs to use the BrowserMatch settings so must - * run after mod_setenvif's post_read_request hook. */ + * run after mod_setenvif's post_read_request hook. */ static const char *pre_prr[] = { "mod_setenvif.c", NULL }; ssl_io_filter_register(p); diff --git a/modules/ssl/ssl_engine_config.c b/modules/ssl/ssl_engine_config.c index 640837a9f4..3105c15b60 100644 --- a/modules/ssl/ssl_engine_config.c +++ b/modules/ssl/ssl_engine_config.c @@ -345,7 +345,7 @@ const char *ssl_cmd_SSLMutex(cmd_parms *cmd, file = NULL; } } - + if ((err = ap_check_cmd_context(cmd, GLOBAL_ONLY))) { return err; } @@ -382,7 +382,7 @@ const char *ssl_cmd_SSLMutex(cmd_parms *cmd, #if APR_HAS_POSIXSEM_SERIALIZE else if (!strcasecmp(meth, "posixsem") || !strcasecmp(meth, "sem")) { mc->nMutexMech = APR_LOCK_POSIXSEM; - /* Posix/SysV semaphores aren't file based, use the literal name + /* Posix/SysV semaphores aren't file based, use the literal name * if provided and fall back on APR's default if not. Today, APR * will ignore it, but once supported it has an absurdly short limit. */ @@ -415,7 +415,7 @@ const char *ssl_cmd_SSLMutex(cmd_parms *cmd, if (file) { mc->szMutexFile = ap_server_root_relative(cmd->server->process->pool, file); if (!mc->szMutexFile) { - return apr_pstrcat(cmd->pool, "Invalid SSLMutex ", meth, + return apr_pstrcat(cmd->pool, "Invalid SSLMutex ", meth, ": filepath ", file, NULL); } } @@ -493,10 +493,10 @@ const char *ssl_cmd_SSLCryptoDevice(cmd_parms *cmd, else { err = "SSLCryptoDevice: Invalid argument; must be one of: " "'builtin' (none)"; - e = ENGINE_get_first(); + e = ENGINE_get_first(); while (e) { ENGINE *en; - err = apr_pstrcat(cmd->pool, err, ", '", ENGINE_get_id(e), + err = apr_pstrcat(cmd->pool, err, ", '", ENGINE_get_id(e), "' (", ENGINE_get_name(e), ")", NULL); en = ENGINE_get_next(e); ENGINE_free(e); @@ -511,7 +511,7 @@ const char *ssl_cmd_SSLCryptoDevice(cmd_parms *cmd, const char *ssl_cmd_SSLRandomSeed(cmd_parms *cmd, void *dcfg, - const char *arg1, + const char *arg1, const char *arg2, const char *arg3) { @@ -658,7 +658,7 @@ static const char *ssl_cmd_check_file(cmd_parms *parms, } return apr_pstrcat(parms->pool, parms->cmd->name, - ": file '", *file, + ": file '", *file, "' does not exist or is empty", NULL); } @@ -690,7 +690,7 @@ static const char *ssl_cmd_check_dir(cmd_parms *parms, } return apr_pstrcat(parms->pool, parms->cmd->name, - ": directory '", *dir, + ": directory '", *dir, "' does not exist", NULL); } @@ -730,7 +730,7 @@ static const char *ssl_cmd_check_aidx_max(cmd_parms *parms, return apr_psprintf(parms->pool, "%s: only up to %d " - "different %s per virtual host allowed", + "different %s per virtual host allowed", parms->cmd->name, SSL_AIDX_MAX, desc); } @@ -930,7 +930,7 @@ const char *ssl_cmd_SSLVerifyClient(cmd_parms *cmd, if ((err = ssl_cmd_verify_parse(cmd, arg, &mode))) { return err; } - + if (cmd->path) { dc->nVerifyClient = mode; } @@ -1064,7 +1064,7 @@ const char *ssl_cmd_SSLSessionCache(cmd_parms *cmd, mc->nSessionCacheMode = SSL_SCMODE_DC; mc->szSessionCacheDataFile = apr_pstrdup(mc->pPool, arg+3); if (!mc->szSessionCacheDataFile) { - return apr_pstrcat(cmd->pool, + return apr_pstrcat(cmd->pool, "SSLSessionCache: Invalid cache file path: ", arg+3, NULL); } @@ -1252,7 +1252,7 @@ const char *ssl_cmd_SSLProxyEngine(cmd_parms *cmd, void *dcfg, int flag) return NULL; } -const char *ssl_cmd_SSLProxyProtocol(cmd_parms *cmd, +const char *ssl_cmd_SSLProxyProtocol(cmd_parms *cmd, void *dcfg, const char *arg) { @@ -1403,7 +1403,7 @@ const char *ssl_cmd_SSLProxyMachineCertificatePath(cmd_parms *cmd, } -const char *ssl_cmd_SSLUserName(cmd_parms *cmd, void *dcfg, +const char *ssl_cmd_SSLUserName(cmd_parms *cmd, void *dcfg, const char *arg) { SSLDirConfigRec *dc = (SSLDirConfigRec *)dcfg; diff --git a/modules/ssl/ssl_engine_dh.c b/modules/ssl/ssl_engine_dh.c index 0b9107ff1c..89c4d4980c 100644 --- a/modules/ssl/ssl_engine_dh.c +++ b/modules/ssl/ssl_engine_dh.c @@ -24,7 +24,7 @@ * | | | | | | (_) | (_| | \__ \__ \ | * |_| |_| |_|\___/ \__,_|___|___/___/_| * |_____| - * ssl_engine_dh.c + * ssl_engine_dh.c * Diffie-Hellman Built-in Temporary Parameters */ @@ -153,7 +153,7 @@ close(FP); # generate the DH parameters print "1. Generate 512 and 1024 bit Diffie-Hellman parameters (p, g)\n"; my $rand = ''; -foreach $file (qw(/var/log/messages /var/adm/messages +foreach $file (qw(/var/log/messages /var/adm/messages /kernel /vmunix /vmlinuz /etc/hosts /etc/resolv.conf)) { if (-f $file) { $rand = $file if ($rand eq ''); @@ -164,7 +164,7 @@ $rand = "-rand $rand" if ($rand ne ''); system("openssl gendh $rand -out dh512.pem 512"); system("openssl gendh $rand -out dh1024.pem 1024"); -# generate DH param info +# generate DH param info my $dhinfo = ''; open(FP, "openssl dh -noout -text -in dh512.pem |") || die; $dhinfo .= $_ while (); diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c index 8ba727c806..54c85fd741 100644 --- a/modules/ssl/ssl_engine_init.c +++ b/modules/ssl/ssl_engine_init.c @@ -171,7 +171,7 @@ int ssl_init_Module(apr_pool_t *p, apr_pool_t *plog, * but it should be initialized for startup before we * call ssl_rand_seed() below. */ - mc->pid = getpid(); + mc->pid = getpid(); /* * Let us cleanup on restarts and exists @@ -207,7 +207,7 @@ int ssl_init_Module(apr_pool_t *p, apr_pool_t *plog, sc->vhost_id = ssl_util_vhostid(p, s); sc->vhost_id_len = strlen(sc->vhost_id); - if (ap_get_server_protocol(s) && + if (ap_get_server_protocol(s) && strcmp("https", ap_get_server_protocol(s)) == 0) { sc->enabled = SSL_ENABLED_TRUE; } @@ -460,7 +460,7 @@ static void ssl_init_ctx_protocol(server_rec *s, SSL_CTX_set_options(ctx, SSL_OP_SINGLE_DH_USE); #ifdef SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION - /* + /* * Disallow a session from being resumed during a renegotiation, * so that an acceptable cipher suite can be negotiated. */ @@ -608,7 +608,7 @@ static void ssl_init_ctx_cipher_suite(server_rec *s, } ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, - "Configuring permitted SSL ciphers [%s]", + "Configuring permitted SSL ciphers [%s]", suite); if (!SSL_CTX_set_cipher_list(ctx, MODSSL_PCHAR_CAST suite)) { @@ -657,7 +657,7 @@ static void ssl_init_ctx_cert_chain(server_rec *s, int i, n; const char *chain = mctx->cert_chain; - /* + /* * Optionally configure extra server certificate chain certificates. * This is usually done by OpenSSL automatically when one of the * server cert issuers are found under SSLCACertificatePath or in @@ -683,7 +683,7 @@ static void ssl_init_ctx_cert_chain(server_rec *s, } n = SSL_CTX_use_certificate_chain(mctx->ssl_ctx, - (char *)chain, + (char *)chain, skip_first, NULL); if (n < 0) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, @@ -833,7 +833,7 @@ static void ssl_check_public_cert(server_rec *s, if (SSL_X509_isSGC(cert)) { ap_log_error(APLOG_MARK, APLOG_INFO, 0, s, "%s server certificate enables " - "Server Gated Cryptography (SGC)", + "Server Gated Cryptography (SGC)", ssl_asn1_keystr(type)); } @@ -1019,7 +1019,7 @@ void ssl_init_CheckServers(server_rec *base_server, apr_pool_t *p) BOOL conflict = FALSE; /* - * Give out warnings when a server has HTTPS configured + * Give out warnings when a server has HTTPS configured * for the HTTP port or vice versa */ for (s = base_server; s; s = s->next) { @@ -1070,11 +1070,11 @@ void ssl_init_CheckServers(server_rec *base_server, apr_pool_t *p) base_server, "Init: SSL server IP/port conflict: " "%s (%s:%d) vs. %s (%s:%d)", - ssl_util_vhostid(p, s), + ssl_util_vhostid(p, s), (s->defn_name ? s->defn_name : "unknown"), s->defn_line_number, ssl_util_vhostid(p, ps), - (ps->defn_name ? ps->defn_name : "unknown"), + (ps->defn_name ? ps->defn_name : "unknown"), ps->defn_line_number); conflict = TRUE; continue; @@ -1258,7 +1258,7 @@ apr_status_t ssl_init_ModuleKill(void *data) */ ssl_scache_kill(base_server); - /* + /* * Destroy the temporary keys and params */ ssl_tmp_keys_free(base_server); diff --git a/modules/ssl/ssl_engine_io.c b/modules/ssl/ssl_engine_io.c index 5527a5ebf9..0093e3b95e 100644 --- a/modules/ssl/ssl_engine_io.c +++ b/modules/ssl/ssl_engine_io.c @@ -64,10 +64,10 @@ * - The char* is placed in a brigade and returned * * Since connection-level input filters in httpd need to be able to - * handle AP_MODE_GETLINE calls (namely identifying LF-terminated strings), + * handle AP_MODE_GETLINE calls (namely identifying LF-terminated strings), * ssl_io_input_getline which will handle this special case. * - * Due to AP_MODE_GETLINE and AP_MODE_SPECULATIVE, we may sometimes have + * Due to AP_MODE_GETLINE and AP_MODE_SPECULATIVE, we may sometimes have * 'leftover' decoded data which must be setaside for the next read. That * is currently handled by the char_buffer_{read|write} functions. So, * ssl_io_input_read may be able to fulfill reads without invoking @@ -81,7 +81,7 @@ * */ -/* this custom BIO allows us to hook SSL_write directly into +/* this custom BIO allows us to hook SSL_write directly into * an apr_bucket_brigade and use transient buckets with the SSL * malloc-ed buffer, rather than copying into a mem BIO. * also allows us to pass the brigade as data is being written @@ -141,7 +141,7 @@ static int bio_filter_out_flush(BIO *bio) if (outctx->blen) { e = apr_bucket_transient_create(outctx->buffer, outctx->blen, outctx->bb->bucket_alloc); - /* we filled this buffer first so add it to the + /* we filled this buffer first so add it to the * head of the brigade */ APR_BRIGADE_INSERT_HEAD(outctx->bb, e); @@ -182,7 +182,7 @@ static int bio_filter_destroy(BIO *bio) */ return 1; } - + static int bio_filter_out_read(BIO *bio, char *out, int outl) { /* this is never called */ @@ -213,7 +213,7 @@ static int bio_filter_out_write(BIO *bio, const char *in, int inl) } else { /* pass along the encrypted data - * need to flush since we're using SSL's malloc-ed buffer + * need to flush since we're using SSL's malloc-ed buffer * which will be overwritten once we leave here */ apr_bucket *bucket = apr_bucket_transient_create(in, inl, @@ -375,7 +375,7 @@ static apr_status_t brigade_consume(apr_bucket_brigade *bb, { apr_size_t actual = 0; apr_status_t status = APR_SUCCESS; - + while (!APR_BRIGADE_EMPTY(bb)) { apr_bucket *b = APR_BRIGADE_FIRST(bb); const char *str; @@ -398,11 +398,11 @@ static apr_status_t brigade_consume(apr_bucket_brigade *bb, * this sort of case (caller provided buffer) it * would be much more trivial for apr_bucket_consume * to do all the work that follows, based on the - * particular characteristics of the bucket we are + * particular characteristics of the bucket we are * consuming here. */ status = apr_bucket_read(b, &str, &str_len, block); - + if (status != APR_SUCCESS) { if (APR_STATUS_IS_EOF(status)) { /* This stream bucket was consumed */ @@ -471,7 +471,7 @@ static int bio_filter_in_read(BIO *bio, char *in, int inlen) */ if ((SSL_version(inctx->ssl) == SSL2_VERSION) || sslconn->is_proxy) { if (bio_filter_out_flush(inctx->bio_out) < 0) { - bio_filter_out_ctx_t *outctx = + bio_filter_out_ctx_t *outctx = (bio_filter_out_ctx_t *)(inctx->bio_out->ptr); inctx->rc = outctx->rc; return -1; @@ -488,7 +488,7 @@ static int bio_filter_in_read(BIO *bio, char *in, int inlen) if (APR_BRIGADE_EMPTY(inctx->bb)) { inctx->rc = ap_get_brigade(inctx->f->next, inctx->bb, - AP_MODE_READBYTES, block, + AP_MODE_READBYTES, block, inl); /* If the read returns EAGAIN or success with an empty @@ -515,12 +515,12 @@ static int bio_filter_in_read(BIO *bio, char *in, int inlen) return (int)inl; } - if (APR_STATUS_IS_EAGAIN(inctx->rc) + if (APR_STATUS_IS_EAGAIN(inctx->rc) || APR_STATUS_IS_EINTR(inctx->rc)) { BIO_set_retry_read(bio); return (int)inl; } - + /* Unexpected errors and APR_EOF clean out the brigade. * Subsequent calls will return APR_EOF. */ @@ -625,7 +625,7 @@ static apr_status_t ssl_io_input_read(bio_filter_in_ctx_t *inctx, */ if (APR_STATUS_IS_EAGAIN(inctx->rc) || APR_STATUS_IS_EINTR(inctx->rc)) { - /* Already read something, return APR_SUCCESS instead. + /* Already read something, return APR_SUCCESS instead. * On win32 in particular, but perhaps on other kernels, * a blocking call isn't 'always' blocking. */ @@ -725,7 +725,7 @@ static apr_status_t ssl_io_input_getline(bio_filter_in_ctx_t *inctx, while (tmplen > 0) { status = ssl_io_input_read(inctx, buf + offset, &tmplen); - + if (status != APR_SUCCESS) { return status; } @@ -815,7 +815,7 @@ static apr_status_t ssl_filter_write(ap_filter_t *f, } ap_log_cerror(APLOG_MARK, APLOG_INFO, outctx->rc, c, - "failed to write %" APR_SSIZE_T_FMT + "failed to write %" APR_SSIZE_T_FMT " of %" APR_SIZE_T_FMT " bytes (%s)", len - (apr_size_t)res, len, reason); @@ -887,7 +887,7 @@ static const char ssl_io_buffer[] = "SSL/TLS Buffer"; /* * Close the SSL part of the socket connection * (called immediately _before_ the socket is closed) - * or called with + * or called with */ static apr_status_t ssl_filter_io_shutdown(ssl_filter_ctx_t *filter_ctx, conn_rec *c, @@ -974,7 +974,7 @@ static apr_status_t ssl_filter_io_shutdown(ssl_filter_ctx_t *filter_ctx, if (c->base_server->loglevel >= APLOG_INFO) { ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, c, "Connection closed to child %ld with %s shutdown " - "(server %s)", + "(server %s)", c->id, type, ssl_util_vhostid(c->pool, c->base_server)); } @@ -1006,7 +1006,7 @@ static apr_status_t ssl_io_filter_cleanup(void *data) SSL_free(filter_ctx->pssl); sslconn->ssl = filter_ctx->pssl = NULL; } - + return APR_SUCCESS; } @@ -1051,7 +1051,7 @@ static int ssl_io_filter_connect(ssl_filter_ctx_t *filter_ctx) (filter_ctx->pbioWrite->ptr); apr_status_t rc = inctx->rc ? inctx->rc : outctx->rc ; ssl_err = SSL_get_error(filter_ctx->pssl, n); - + if (ssl_err == SSL_ERROR_ZERO_RETURN) { /* * The case where the connection was closed before any data @@ -1063,7 +1063,7 @@ static int ssl_io_filter_connect(ssl_filter_ctx_t *filter_ctx) } else if (ssl_err == SSL_ERROR_WANT_READ) { /* - * This is in addition to what was present earlier. It is + * This is in addition to what was present earlier. It is * borrowed from openssl_state_machine.c [mod_tls]. * TBD. */ @@ -1117,7 +1117,7 @@ static int ssl_io_filter_connect(ssl_filter_ctx_t *filter_ctx) /* leaving this log message as an error for the moment, * according to the mod_ssl docs: * "level optional_no_ca is actually against the idea - * of authentication (but can be used to establish + * of authentication (but can be used to establish * SSL test pages, etc.)" * optional_no_ca doesn't appear to work as advertised * in 1.x @@ -1205,20 +1205,20 @@ static apr_status_t ssl_io_filter_Upgrade(ap_filter_t *f, /* Send the interim 101 response. */ upgradebb = apr_brigade_create(r->pool, f->c->bucket_alloc); - + ap_fputstrs(f->next, upgradebb, SWITCH_STATUS_LINE, CRLF, UPGRADE_HEADER, CRLF, CONNECTION_HEADER, CRLF, CRLF, NULL); b = apr_bucket_flush_create(f->c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(upgradebb, b); - + rv = ap_pass_brigade(f->next, upgradebb); if (rv) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "could not send interim 101 Upgrade response"); return AP_FILTER_ERROR; } - + ssl_init_ssl_connection(f->c); ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, @@ -1228,7 +1228,7 @@ static apr_status_t ssl_io_filter_Upgrade(ap_filter_t *f, ssl = sslconn->ssl; /* XXX: Should replace SSL_set_state with SSL_renegotiate(ssl); - * However, this causes failures in perl-framework currently, + * However, this causes failures in perl-framework currently, * perhaps pre-test if we have already negotiated? */ SSL_set_accept_state(ssl); @@ -1242,8 +1242,8 @@ static apr_status_t ssl_io_filter_Upgrade(ap_filter_t *f, return AP_FILTER_ERROR; } - /* Now that we have initialized the ssl connection which added the ssl_io_filter, - pass the brigade off to the connection based output filters so that the + /* Now that we have initialized the ssl connection which added the ssl_io_filter, + pass the brigade off to the connection based output filters so that the request can complete encrypted */ return ap_pass_brigade(f->c->output_filters, bb); @@ -1276,7 +1276,7 @@ static apr_status_t ssl_io_filter_input(ap_filter_t *f, } /* XXX: we don't currently support anything other than these modes. */ - if (mode != AP_MODE_READBYTES && mode != AP_MODE_GETLINE && + if (mode != AP_MODE_READBYTES && mode != AP_MODE_GETLINE && mode != AP_MODE_SPECULATIVE && mode != AP_MODE_INIT) { return APR_ENOTIMPL; } @@ -1300,9 +1300,9 @@ static apr_status_t ssl_io_filter_input(ap_filter_t *f, return APR_SUCCESS; } - if (inctx->mode == AP_MODE_READBYTES || + if (inctx->mode == AP_MODE_READBYTES || inctx->mode == AP_MODE_SPECULATIVE) { - /* Protected from truncation, readbytes < MAX_SIZE_T + /* Protected from truncation, readbytes < MAX_SIZE_T * FIXME: No, it's *not* protected. -- jre */ if (readbytes < len) { len = (apr_size_t)readbytes; @@ -1367,8 +1367,8 @@ static apr_status_t ssl_io_filter_output(ap_filter_t *f, while (!APR_BRIGADE_EMPTY(bb)) { apr_bucket *bucket = APR_BRIGADE_FIRST(bb); - /* If it is a flush or EOS, we need to pass this down. - * These types do not require translation by OpenSSL. + /* If it is a flush or EOS, we need to pass this down. + * These types do not require translation by OpenSSL. */ if (APR_BUCKET_IS_EOS(bucket) || APR_BUCKET_IS_FLUSH(bucket)) { if (bio_filter_out_flush(filter_ctx->pbioWrite) < 0) { @@ -1416,7 +1416,7 @@ static apr_status_t ssl_io_filter_output(ap_filter_t *f, /* filter output */ const char *data; apr_size_t len; - + status = apr_bucket_read(bucket, &data, &len, rblock); if (APR_STATUS_IS_EAGAIN(status)) { @@ -1464,7 +1464,7 @@ int ssl_io_buffer_fill(request_rec *r) apr_bucket_brigade *tempb; apr_off_t total = 0; /* total length buffered */ int eos = 0; /* non-zero once EOS is seen */ - + /* Create the context which will be passed to the input filter; * containing a setaside pool and a brigade which constrain the * lifetime of the buffered data. */ @@ -1493,10 +1493,10 @@ int ssl_io_buffer_fill(request_rec *r) "could not read request body for SSL buffer"); return HTTP_INTERNAL_SERVER_ERROR; } - + /* Iterate through the returned brigade: setaside each bucket * into the context's pool and move it into the brigade. */ - for (e = APR_BRIGADE_FIRST(tempb); + for (e = APR_BRIGADE_FIRST(tempb); e != APR_BRIGADE_SENTINEL(tempb) && !eos; e = next) { const char *data; apr_size_t len; @@ -1514,19 +1514,19 @@ int ssl_io_buffer_fill(request_rec *r) } total += len; } - + rv = apr_bucket_setaside(e, ctx->pool); if (rv != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "could not setaside bucket for SSL buffer"); return HTTP_INTERNAL_SERVER_ERROR; } - + APR_BUCKET_REMOVE(e); APR_BRIGADE_INSERT_TAIL(ctx->bb, e); } - ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, c, + ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, c, "total of %" APR_OFF_T_FMT " bytes in buffer, eos=%d", total, eos); @@ -1587,7 +1587,7 @@ static apr_status_t ssl_io_filter_buffer(ap_filter_t *f, apr_bucket *d = APR_BRIGADE_FIRST(ctx->bb); e = APR_BUCKET_PREV(e); - + /* Unsplice the partitioned segment and move it into the * passed-in brigade; no convenient way to do this with * the APR_BRIGADE_* macros. */ @@ -1612,7 +1612,7 @@ static apr_status_t ssl_io_filter_buffer(ap_filter_t *f, if (APR_BRIGADE_EMPTY(ctx->bb)) { apr_bucket *e = APR_BRIGADE_LAST(bb); - + /* Ensure that the brigade is terminated by an EOS if the * buffered request body has been entirely consumed. */ if (e == APR_BRIGADE_SENTINEL(bb) || !APR_BUCKET_IS_EOS(e)) { @@ -1690,7 +1690,7 @@ void ssl_io_filter_register(apr_pool_t *p) ap_register_input_filter (ssl_io_filter, ssl_io_filter_input, NULL, AP_FTYPE_CONNECTION + 5); ap_register_output_filter (ssl_io_filter, ssl_io_filter_output, NULL, AP_FTYPE_CONNECTION + 5); - + ap_register_input_filter (ssl_io_buffer, ssl_io_filter_buffer, NULL, AP_FTYPE_PROTOCOL - 1); return; diff --git a/modules/ssl/ssl_engine_kernel.c b/modules/ssl/ssl_engine_kernel.c index 032e142475..688cb47359 100644 --- a/modules/ssl/ssl_engine_kernel.c +++ b/modules/ssl/ssl_engine_kernel.c @@ -74,7 +74,7 @@ int ssl_hook_ReadReq(request_rec *r) * with using SSL on this request. */ sslconn->non_ssl_request = 0; - + return HTTP_BAD_REQUEST; } @@ -191,7 +191,7 @@ int ssl_hook_Access(request_rec *r) return HTTP_UPGRADE_REQUIRED; } - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "access to %s failed, reason: %s", r->filename, "SSL connection required"); @@ -214,8 +214,8 @@ int ssl_hook_Access(request_rec *r) * reconfigured parameter suite. But Apache's internal API processing * makes our life very hard here, because when internal sub-requests occur * we nevertheless should avoid multiple unnecessary SSL handshakes (they - * require extra network I/O and especially time to perform). - * + * require extra network I/O and especially time to perform). + * * But the optimization for filtering out the unnecessary handshakes isn't * obvious and trivial. Especially because while Apache is in its * sub-request processing the client could force additional handshakes, @@ -369,7 +369,7 @@ int ssl_hook_Access(request_rec *r) * override of SSLVerifyClient * * We force a renegotiation if the reconfigured/new verify type is - * stronger than the currently active verify type. + * stronger than the currently active verify type. * * The order is: none << optional_no_ca << optional << require * @@ -498,7 +498,7 @@ int ssl_hook_Access(request_rec *r) * handshake immediately; once the SSL library moves to the * "accept" state, it will reject the SSL packets which the client * is sending for the request body. - * + * * To allow authentication to complete in this auth hook, the * solution used here is to fill a (bounded) buffer with the * request body, and then to reinject that request body later. @@ -633,7 +633,7 @@ int ssl_hook_Access(request_rec *r) "Awaiting re-negotiation handshake"); /* XXX: Should replace SSL_set_state with SSL_renegotiate(ssl); - * However, this causes failures in perl-framework currently, + * However, this causes failures in perl-framework currently, * perhaps pre-test if we have already negotiated? */ SSL_set_state(ssl, SSL_ST_ACCEPT); @@ -686,7 +686,7 @@ int ssl_hook_Access(request_rec *r) X509_free(peercert); } } - + /* * Also check that SSLCipherSuite has been enforced as expected. */ @@ -718,7 +718,7 @@ int ssl_hook_Access(request_rec *r) else ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, "Failed to set r->user to '%s'", dc->szUserName); - } + } /* * Check SSLRequire boolean expressions @@ -736,7 +736,7 @@ int ssl_hook_Access(request_rec *r) "SSL requirement expression: %s", ssl_expr_get_error()); - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "access to %s failed, reason: %s", r->filename, cp); @@ -755,7 +755,7 @@ int ssl_hook_Access(request_rec *r) ap_log_error(APLOG_MARK, APLOG_INFO, 0, r->server, "Failed expression: %s", req->cpExpr); - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "access to %s failed, reason: %s", r->filename, "SSL requirement expression not fulfilled " @@ -844,13 +844,13 @@ int ssl_hook_UserCheck(request_rec *r) * - ssl not enabled * - client did not present a certificate */ - if (!((sc->enabled == SSL_ENABLED_TRUE || sc->enabled == SSL_ENABLED_OPTIONAL) + if (!((sc->enabled == SSL_ENABLED_TRUE || sc->enabled == SSL_ENABLED_OPTIONAL) && sslconn && sslconn->ssl && sslconn->client_cert) || !(dc->nOptions & SSL_OPT_FAKEBASICAUTH) || r->user) { return DECLINED; } - + if (!sslconn->client_dn) { X509_NAME *name = X509_get_subject_name(sslconn->client_cert); char *cp = X509_NAME_oneline(name, NULL, 0); @@ -871,9 +871,9 @@ int ssl_hook_UserCheck(request_rec *r) * adding the string "xxj31ZMTZzkVA" as the password in the user file. * This is just the crypted variant of the word "password" ;-) */ - auth_line = apr_pstrcat(r->pool, "Basic ", - ap_pbase64encode(r->pool, - apr_pstrcat(r->pool, clientdn, + auth_line = apr_pstrcat(r->pool, "Basic ", + ap_pbase64encode(r->pool, + apr_pstrcat(r->pool, clientdn, ":password", NULL)), NULL); apr_table_set(r->headers_in, "Authorization", auth_line); @@ -1016,7 +1016,7 @@ int ssl_hook_Fixup(request_rec *r) * Annotate the SSI/CGI environment with standard SSL information */ /* the always present HTTPS (=HTTP over SSL) flag! */ - apr_table_setn(env, "HTTPS", "on"); + apr_table_setn(env, "HTTPS", "on"); /* standard SSL environment variables */ if (dc->nOptions & SSL_OPT_STDENVVARS) { @@ -1131,7 +1131,7 @@ RSA *ssl_callback_TmpRSA(SSL *ssl, int export, int keylen) return (RSA *)mc->pTmpKeys[idx]; } -/* +/* * Hand out the already generated DH parameters... */ DH *ssl_callback_TmpDH(SSL *ssl, int export, int keylen) @@ -1214,7 +1214,7 @@ int ssl_callback_SSLVerify(int ok, X509_STORE_CTX *ctx) } if (verify == SSL_CVERIFY_NONE) { - /* + /* * SSLProxyVerify is either not configured or set to "none". * (this callback doesn't happen in the server context if SSLVerify * is not configured or set to "none") @@ -1497,7 +1497,7 @@ static void modssl_proxy_info_log(server_rec *s, dn = X509_NAME_oneline(name, name_buf, sizeof(name_buf)); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, - SSLPROXY_CERT_CB_LOG_FMT "%s, sending %s", + SSLPROXY_CERT_CB_LOG_FMT "%s, sending %s", sc->vhost_id, msg, dn ? dn : "-uknown-"); } @@ -1512,7 +1512,7 @@ static void modssl_proxy_info_log(server_rec *s, *pkey = info->x_pkey->dec_pkey; \ EVP_PKEY_reference_inc(*pkey) -int ssl_callback_proxy_cert(SSL *ssl, MODSSL_CLIENT_CERT_CB_ARG_TYPE **x509, EVP_PKEY **pkey) +int ssl_callback_proxy_cert(SSL *ssl, MODSSL_CLIENT_CERT_CB_ARG_TYPE **x509, EVP_PKEY **pkey) { conn_rec *c = (conn_rec *)SSL_get_app_data(ssl); server_rec *s = c->base_server; @@ -1522,8 +1522,8 @@ int ssl_callback_proxy_cert(SSL *ssl, MODSSL_CLIENT_CERT_CB_ARG_TYPE **x509, EVP STACK_OF(X509_NAME) *ca_list; STACK_OF(X509_INFO) *certs = sc->proxy->pkp->certs; int i, j; - - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, + + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, SSLPROXY_CERT_CB_LOG_FMT "entered", sc->vhost_id); @@ -1533,23 +1533,23 @@ int ssl_callback_proxy_cert(SSL *ssl, MODSSL_CLIENT_CERT_CB_ARG_TYPE **x509, EVP "downstream server wanted client certificate " "but none are configured", sc->vhost_id); return FALSE; - } + } ca_list = SSL_get_client_CA_list(ssl); if (!ca_list || (sk_X509_NAME_num(ca_list) <= 0)) { - /* - * downstream server didn't send us a list of acceptable CA certs, + /* + * downstream server didn't send us a list of acceptable CA certs, * so we send the first client cert in the list. - */ + */ info = sk_X509_INFO_value(certs, 0); - + modssl_proxy_info_log(s, info, "no acceptable CA list"); modssl_set_cert_info(info, x509, pkey); return TRUE; - } + } for (i = 0; i < sk_X509_NAME_num(ca_list); i++) { ca_name = sk_X509_NAME_value(ca_list, i); @@ -1572,7 +1572,7 @@ int ssl_callback_proxy_cert(SSL *ssl, MODSSL_CLIENT_CERT_CB_ARG_TYPE **x509, EVP SSLPROXY_CERT_CB_LOG_FMT "no client certificate found!?", sc->vhost_id); - return FALSE; + return FALSE; } static void ssl_session_log(server_rec *s, diff --git a/modules/ssl/ssl_engine_log.c b/modules/ssl/ssl_engine_log.c index 0c1d1cc2d0..e7766c1439 100644 --- a/modules/ssl/ssl_engine_log.c +++ b/modules/ssl/ssl_engine_log.c @@ -56,7 +56,7 @@ static const char *ssl_log_annotation(const char *error) { int i = 0; - while (ssl_log_annotate[i].cpPattern != NULL + while (ssl_log_annotate[i].cpPattern != NULL && ap_strcmp_match(error, ssl_log_annotate[i].cpPattern) != 0) i++; @@ -90,12 +90,12 @@ void ssl_log_ssl_error(const char *file, int line, int level, server_rec *s) if (annotation) { ap_log_error(file, line, level, 0, s, "SSL Library Error: %lu %s %s", - e, err, annotation); + e, err, annotation); } else { ap_log_error(file, line, level, 0, s, "SSL Library Error: %lu %s", - e, err); + e, err); } } } diff --git a/modules/ssl/ssl_engine_mutex.c b/modules/ssl/ssl_engine_mutex.c index 65924d269e..effb01d484 100644 --- a/modules/ssl/ssl_engine_mutex.c +++ b/modules/ssl/ssl_engine_mutex.c @@ -39,7 +39,7 @@ int ssl_mutex_init(server_rec *s, apr_pool_t *p) SSLModConfigRec *mc = myModConfig(s); apr_status_t rv; - if (mc->nMutexMode == SSL_MUTEXMODE_NONE) + if (mc->nMutexMode == SSL_MUTEXMODE_NONE) return TRUE; if (mc->pMutex) { diff --git a/modules/ssl/ssl_engine_pphrase.c b/modules/ssl/ssl_engine_pphrase.c index 851289257b..ef5bd05863 100644 --- a/modules/ssl/ssl_engine_pphrase.c +++ b/modules/ssl/ssl_engine_pphrase.c @@ -324,9 +324,9 @@ void ssl_pphrase_Handle(server_rec *s, apr_pool_t *p) for (i=0; i < SSL_AIDX_MAX; i++) { const char *key_id = ssl_asn1_table_keyfmt(p, cpVHostID, i); - ssl_asn1_t *asn1 = + ssl_asn1_t *asn1 = ssl_asn1_table_get(mc->tPrivateKey, key_id); - + if (asn1 && (asn1->source_mtime == pkey_mtime)) { ap_log_error(APLOG_MARK, APLOG_INFO, 0, pServ, @@ -466,20 +466,20 @@ void ssl_pphrase_Handle(server_rec *s, apr_pool_t *p) * Log the type of reading */ if (nPassPhraseDialogCur == 0) { - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, pServ, + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, pServ, "unencrypted %s private key - pass phrase not " "required", an); } else { if (cpPassPhraseCur != NULL) { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, - pServ, + pServ, "encrypted %s private key - pass phrase " "requested", an); } else { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, - pServ, + pServ, "encrypted %s private key - pass phrase" " reused", an); } @@ -566,7 +566,7 @@ static apr_status_t ssl_pipe_child_create(apr_pool_t *p, const char *progname) 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)); @@ -594,7 +594,7 @@ static int pipe_get_passwd_cb(char *buf, int length, char *prompt, int verify) buf[0]='\0'; rc = apr_file_gets(buf, length, readtty); apr_file_puts(APR_EOL_STR, writetty); - + if (rc != APR_SUCCESS || apr_file_eof(readtty)) { memset(buf, 0, length); return 1; /* failure */ @@ -689,7 +689,7 @@ int ssl_pphrase_Handle_CB(char *buf, int bufsize, int verify, void *srv) ap_log_error(APLOG_MARK, APLOG_INFO, 0, s, "Init: Requesting pass phrase via piped dialog"); } - else { /* sc->server->pphrase_dialog_type == SSL_PPTYPE_BUILTIN */ + else { /* sc->server->pphrase_dialog_type == SSL_PPTYPE_BUILTIN */ #ifdef WIN32 PEMerr(PEM_F_DEF_CALLBACK,PEM_R_PROBLEMS_GETTING_PASSWORD); memset(buf, 0, (unsigned int)bufsize); @@ -736,11 +736,11 @@ int ssl_pphrase_Handle_CB(char *buf, int bufsize, int verify, void *srv) for (;;) { apr_file_puts(prompt, writetty); if (sc->server->pphrase_dialog_type == SSL_PPTYPE_PIPE) { - i = pipe_get_passwd_cb(buf, bufsize, "", FALSE); - } + i = pipe_get_passwd_cb(buf, bufsize, "", FALSE); + } else { /* sc->server->pphrase_dialog_type == SSL_PPTYPE_BUILTIN */ - i = EVP_read_pw_string(buf, bufsize, "", FALSE); - } + i = EVP_read_pw_string(buf, bufsize, "", FALSE); + } if (i != 0) { PEMerr(PEM_F_DEF_CALLBACK,PEM_R_PROBLEMS_GETTING_PASSWORD); memset(buf, 0, (unsigned int)bufsize); diff --git a/modules/ssl/ssl_engine_rand.c b/modules/ssl/ssl_engine_rand.c index 486759c702..5b7e60bdf0 100644 --- a/modules/ssl/ssl_engine_rand.c +++ b/modules/ssl/ssl_engine_rand.c @@ -62,7 +62,7 @@ int ssl_rand_seed(server_rec *s, apr_pool_t *p, ssl_rsctx_t nCtx, char *prefix) /* * seed in contents of an external file */ - if (apr_file_open(&fp, pRandSeed->cpPath, + if (apr_file_open(&fp, pRandSeed->cpPath, APR_READ, APR_OS_DEFAULT, p) != APR_SUCCESS) continue; nDone += ssl_rand_feedfp(p, fp, pRandSeed->nBytes); @@ -113,7 +113,7 @@ int ssl_rand_seed(server_rec *s, apr_pool_t *p, ssl_rsctx_t nCtx, char *prefix) l = sizeof(my_seed); RAND_seed((unsigned char *)&my_seed, l); nDone += l; - + /* * seed in some current state of the run-time stack (128 bytes) */ diff --git a/modules/ssl/ssl_engine_vars.c b/modules/ssl/ssl_engine_vars.c index 5f1f571096..f9c9d539c5 100644 --- a/modules/ssl/ssl_engine_vars.c +++ b/modules/ssl/ssl_engine_vars.c @@ -117,7 +117,7 @@ char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, case 'R': case 'r': - if (strcEQ(var, "REQUEST_METHOD")) + if (strcEQ(var, "REQUEST_METHOD")) result = r->method; else if (strcEQ(var, "REQUEST_SCHEME")) result = ap_http_scheme(r); @@ -126,7 +126,7 @@ char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, else if (strcEQ(var, "REQUEST_FILENAME")) result = r->filename; else if (strcEQ(var, "REMOTE_HOST")) - result = ap_get_remote_host(r->connection, r->per_dir_config, + result = ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME, NULL); else if (strcEQ(var, "REMOTE_IDENT")) result = ap_get_remote_logname(r); @@ -137,7 +137,7 @@ char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, case 'S': case 's': if (strcEQn(var, "SSL", 3)) break; /* shortcut common case */ - + if (strcEQ(var, "SERVER_ADMIN")) result = r->server->server_admin; else if (strcEQ(var, "SERVER_NAME")) @@ -149,7 +149,7 @@ char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, else if (strcEQ(var, "SCRIPT_FILENAME")) result = r->filename; break; - + default: if (strcEQ(var, "PATH_INFO")) result = r->path_info; @@ -172,7 +172,7 @@ char *ssl_var_lookup(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, */ if (result == NULL && c != NULL) { SSLConnRec *sslconn = myConnConfig(c); - if (strlen(var) > 4 && strcEQn(var, "SSL_", 4) + if (strlen(var) > 4 && strcEQn(var, "SSL_", 4) && sslconn && sslconn->ssl) result = ssl_var_lookup_ssl(p, c, var+4); else if (strcEQ(var, "REMOTE_ADDR")) @@ -357,7 +357,7 @@ static char *ssl_var_lookup_ssl_cert(apr_pool_t *p, X509 *xs, char *var) } else if (strcEQ(var, "A_SIG")) { nid = OBJ_obj2nid((ASN1_OBJECT *)X509_get_signature_algorithm(xs)); - result = apr_pstrdup(p, + result = apr_pstrdup(p, (nid == NID_undef) ? "UNKNOWN" : OBJ_nid2ln(nid)); resdup = FALSE; } @@ -476,7 +476,7 @@ static char *ssl_var_lookup_ssl_cert_remain(apr_pool_t *p, ASN1_UTCTIME *tm) /* Fail if the time isn't a valid ASN.1 UTCTIME; RFC3280 mandates * that the seconds digits are present even though ASN.1 - * doesn't. */ + * doesn't. */ if (tm->length < 11 || !ASN1_UTCTIME_check(tm)) { return apr_pstrdup(p, "0"); } @@ -493,7 +493,7 @@ static char *ssl_var_lookup_ssl_cert_remain(apr_pool_t *p, ASN1_UTCTIME *tm) if (apr_time_exp_gmt_get(&then, &exp) != APR_SUCCESS) { return apr_pstrdup(p, "0"); } - + diff = (long)((apr_time_sec(then) - apr_time_sec(now)) / (60*60*24)); return diff > 0 ? apr_ltoa(p, diff) : apr_pstrdup(p, "0"); @@ -589,7 +589,7 @@ static char *ssl_var_lookup_ssl_cert_verify(apr_pool_t *p, conn_rec *c) static char *ssl_var_lookup_ssl_cipher(apr_pool_t *p, conn_rec *c, char *var) { - SSLConnRec *sslconn = myConnConfig(c); + SSLConnRec *sslconn = myConnConfig(c); char *result; BOOL resdup; int usekeysize, algkeysize; @@ -676,13 +676,13 @@ apr_array_header_t *ssl_ext_list(apr_pool_t *p, conn_rec *c, int peer, } ssl = sslconn->ssl; - /* We accept the "extension" string to be converted as - * a long name (nsComment), short name (DN) or + /* We accept the "extension" string to be converted as + * a long name (nsComment), short name (DN) or * numeric OID (1.2.3.4). */ oid = OBJ_txt2obj(extension, 0); if (!oid) { - ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, c, + ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, c, "Failed to create an object for extension '%s'", extension); ERR_clear_error(); @@ -707,9 +707,9 @@ apr_array_header_t *ssl_ext_list(apr_pool_t *p, conn_rec *c, int peer, /* We want to obtain a string representation of the extensions * value and add it to the array we're building. - * X509V3_EXT_print() doesn't know about all the possible + * X509V3_EXT_print() doesn't know about all the possible * data types, but the value is stored as an ASN1_OCTET_STRING - * allowing us a fallback in case of X509V3_EXT_print + * allowing us a fallback in case of X509V3_EXT_print * not knowing how to handle the data. */ if (X509V3_EXT_print(bio, ext, 0, 0) == 1 || @@ -721,7 +721,7 @@ apr_array_header_t *ssl_ext_list(apr_pool_t *p, conn_rec *c, int peer, } else { ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, c, "Found an extension '%s', but failed to " - "create a string from it", extension); + "create a string from it", extension); } BIO_vfree(bio); } diff --git a/modules/ssl/ssl_expr_eval.c b/modules/ssl/ssl_expr_eval.c index 76e0107fc0..ec498275a3 100644 --- a/modules/ssl/ssl_expr_eval.c +++ b/modules/ssl/ssl_expr_eval.c @@ -228,7 +228,7 @@ static char *ssl_expr_eval_func_file(request_rec *r, char *filename) apr_size_t len; apr_finfo_t finfo; - if (apr_file_open(&fp, filename, APR_READ|APR_BUFFERED, + if (apr_file_open(&fp, filename, APR_READ|APR_BUFFERED, APR_OS_DEFAULT, r->pool) != APR_SUCCESS) { ssl_expr_error = "Cannot open file"; return ""; diff --git a/modules/ssl/ssl_expr_parse.c b/modules/ssl/ssl_expr_parse.c index ee172a78e1..d1efa59c94 100644 --- a/modules/ssl/ssl_expr_parse.c +++ b/modules/ssl/ssl_expr_parse.c @@ -1,5 +1,5 @@ #ifndef lint -static char const +static char const ssl_expr_yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28.2.1 2001/07/19 05:46:39 peter Exp $"; #endif #include @@ -530,9 +530,9 @@ case 25: break; case 26: #line 121 "ssl_expr_parse.y" -{ +{ ap_regex_t *regex; - if ((regex = ap_pregcomp(ssl_expr_info.pool, ssl_expr_yyvsp[0].cpVal, + if ((regex = ap_pregcomp(ssl_expr_info.pool, ssl_expr_yyvsp[0].cpVal, AP_REG_EXTENDED|AP_REG_NOSUB)) == NULL) { ssl_expr_error = "Failed to compile regular expression"; YYERROR; @@ -544,7 +544,7 @@ case 27: #line 130 "ssl_expr_parse.y" { ap_regex_t *regex; - if ((regex = ap_pregcomp(ssl_expr_info.pool, ssl_expr_yyvsp[0].cpVal, + if ((regex = ap_pregcomp(ssl_expr_info.pool, ssl_expr_yyvsp[0].cpVal, AP_REG_EXTENDED|AP_REG_NOSUB|AP_REG_ICASE)) == NULL) { ssl_expr_error = "Failed to compile regular expression"; YYERROR; @@ -554,7 +554,7 @@ case 27: break; case 28: #line 141 "ssl_expr_parse.y" -{ +{ ssl_expr *args = ssl_expr_make(op_ListElement, ssl_expr_yyvsp[-1].cpVal, NULL); ssl_expr_yyval.exVal = ssl_expr_make(op_Func, "file", args); } diff --git a/modules/ssl/ssl_expr_scan.c b/modules/ssl/ssl_expr_scan.c index 705b2468ad..7d7bb85fd3 100644 --- a/modules/ssl/ssl_expr_scan.c +++ b/modules/ssl/ssl_expr_scan.c @@ -475,16 +475,16 @@ char *yytext; * See the License for the specific language governing permissions and * limitations under the License. */ -/* _ _ - * _ __ ___ ___ __| | ___ ___| | - * | '_ ` _ \ / _ \ / _` | / __/ __| | +/* _ _ + * _ __ ___ ___ __| | ___ ___| | + * | '_ ` _ \ / _ \ / _` | / __/ __| | * | | | | | | (_) | (_| | \__ \__ \ | mod_ssl - Apache Interface to OpenSSL * |_| |_| |_|\___/ \__,_|___|___/___/_| http://www.modssl.org/ - * |_____| + * |_____| * ssl_expr_scan.l * Expression Scanner */ -/* ``Killing for peace is +/* ``Killing for peace is like fucking for virginity.'' -- Unknown */ /* _________________________________________________________________ @@ -665,7 +665,7 @@ YY_DECL #line 58 "ssl_expr_scan.l" - + char caStr[MAX_STR_LEN]; char *cpStr = NULL; char caRegex[MAX_STR_LEN]; @@ -757,7 +757,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP #line 69 "ssl_expr_scan.l" -{ +{ /* NOP */ } YY_BREAK @@ -1071,7 +1071,7 @@ YY_RULE_SETUP case 46: YY_RULE_SETUP #line 208 "ssl_expr_scan.l" -{ +{ return yytext[0]; } YY_BREAK @@ -1977,7 +1977,7 @@ int yyinput(char *buf, int max_size) int n; if ((n = MIN(max_size, ssl_expr_info.inputbuf - + ssl_expr_info.inputlen + + ssl_expr_info.inputlen - ssl_expr_info.inputptr)) <= 0) return YY_NULL; memcpy(buf, ssl_expr_info.inputptr, n); diff --git a/modules/ssl/ssl_scache.c b/modules/ssl/ssl_scache.c index 877dc0779d..b3af2fd0f9 100644 --- a/modules/ssl/ssl_scache.c +++ b/modules/ssl/ssl_scache.c @@ -162,7 +162,7 @@ static int ssl_ext_status_hook(request_rec *r, int flags) else if (sc->mc->nSessionCacheMode == SSL_SCMODE_DC) ssl_scache_dc_status(r, flags, r->pool); #endif - + ap_rputs("
    \n", r); return OK; diff --git a/modules/ssl/ssl_scache_dbm.c b/modules/ssl/ssl_scache_dbm.c index 34a898c24f..ac8b216322 100644 --- a/modules/ssl/ssl_scache_dbm.c +++ b/modules/ssl/ssl_scache_dbm.c @@ -209,7 +209,7 @@ SSL_SESSION *ssl_scache_dbm_retrieve(server_rec *s, UCHAR *id, int idlen) dbmkey.dptr = (char *)id; dbmkey.dsize = idlen; - /* and fetch it from the DBM file + /* and fetch it from the DBM file * XXX: Should we open the dbm against r->pool so the cleanup will * do the apr_dbm_close? This would make the code a bit cleaner. */ @@ -244,7 +244,7 @@ SSL_SESSION *ssl_scache_dbm_retrieve(server_rec *s, UCHAR *id, int idlen) return NULL; } /* Cast needed, ucpData may be const */ - memcpy((unsigned char *)ucpData, + memcpy((unsigned char *)ucpData, (char *)dbmval.dptr + sizeof(time_t), nData); memcpy(&expiry, dbmval.dptr, sizeof(time_t)); @@ -347,7 +347,7 @@ static void ssl_scache_dbm_expire(server_rec *s) /* pass 1: scan DBM database */ keyidx = 0; - if ((rv = apr_dbm_open(&dbm, mc->szSessionCacheDataFile, + if ((rv = apr_dbm_open(&dbm, mc->szSessionCacheDataFile, APR_DBM_RWCREATE,SSL_DBM_FILE_MODE, p)) != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, diff --git a/modules/ssl/ssl_scache_dc.c b/modules/ssl/ssl_scache_dc.c index 3d7d61c384..97f4581b50 100644 --- a/modules/ssl/ssl_scache_dc.c +++ b/modules/ssl/ssl_scache_dc.c @@ -81,8 +81,8 @@ void ssl_scache_dc_init(server_rec *s, apr_pool_t *p) ssl_die(); } ap_log_error(APLOG_MARK, APLOG_INFO, 0, s, "distributed scache context initialised"); - /* - * Success ... + /* + * Success ... */ mc->tSessionCacheDataTable = ctx; return; @@ -167,7 +167,7 @@ void ssl_scache_dc_status(request_rec *r, int flags, apr_pool_t *pool) { SSLModConfigRec *mc = myModConfig(r->server); - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "distributed scache 'ssl_scache_dc_status'"); ap_rprintf(r, "cache type: DC (Distributed Cache), " " target: %s
    ", mc->szSessionCacheDataFile); diff --git a/modules/ssl/ssl_scache_shmcb.c b/modules/ssl/ssl_scache_shmcb.c index 741a20e833..024d1955ad 100644 --- a/modules/ssl/ssl_scache_shmcb.c +++ b/modules/ssl/ssl_scache_shmcb.c @@ -26,7 +26,7 @@ #include "ssl_private.h" -/* +/* * This shared memory based SSL session cache implementation was * originally written by Geoff Thorpe for C2Net * Europe as a contribution to Ralf Engelschall's mod_ssl project. @@ -88,7 +88,7 @@ * how many session-retrieves have failed. * - removes_hit (unsigned long): * - removes_miss (unsigned long): - * + * * Following immediately after the header is an array of "divisions". * Each division is simply a "queue" immediately followed by its * corresponding "cache". Each division handles some pre-defined band @@ -135,7 +135,7 @@ * sessions are stored. */ -/* +/* * Header - can be memcpy'd to and from the front of the shared * memory segment. NB: The first copy (commented out) has the * elements in a meaningful order, but due to data-alignment @@ -161,7 +161,7 @@ typedef struct { unsigned int index_size; } SHMCBHeader; -/* +/* * Index - can be memcpy'd to and from an index inside each * queue's index array. */ @@ -172,7 +172,7 @@ typedef struct { unsigned char removed; } SHMCBIndex; -/* +/* * Queue - must be populated by a call to shmcb_get_division * and the structure's pointers are used for updating (ie. * the structure doesn't need any "set" to update values). @@ -184,7 +184,7 @@ typedef struct { SHMCBIndex *indexes; } SHMCBQueue; -/* +/* * Cache - same comment as for Queue. 'Queue's are in a 1-1 * correspondance with 'Cache's and are usually carried round * in a pair, they are only seperated for clarity. @@ -341,17 +341,17 @@ void ssl_scache_shmcb_init(server_rec *s, apr_pool_t *p) } /* Use anonymous shm by default, fall back on name-based. */ - rv = apr_shm_create(&(mc->pSessionCacheDataMM), - mc->nSessionCacheDataSize, + rv = apr_shm_create(&(mc->pSessionCacheDataMM), + mc->nSessionCacheDataSize, NULL, mc->pPool); - + if (APR_STATUS_IS_ENOTIMPL(rv)) { /* For a name-based segment, remove it first in case of a * previous unclean shutdown. */ apr_shm_remove(mc->szSessionCacheDataFile, mc->pPool); - - rv = apr_shm_create(&(mc->pSessionCacheDataMM), - mc->nSessionCacheDataSize, + + rv = apr_shm_create(&(mc->pSessionCacheDataMM), + mc->nSessionCacheDataSize, mc->szSessionCacheDataFile, mc->pPool); } @@ -367,7 +367,7 @@ void ssl_scache_shmcb_init(server_rec *s, apr_pool_t *p) shm_segsize = apr_shm_size_get(mc->pSessionCacheDataMM); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, - "shmcb_init allocated %" APR_SIZE_T_FMT + "shmcb_init allocated %" APR_SIZE_T_FMT " bytes of shared memory", shm_segsize); if (!shmcb_init_memory(s, shm_segment, shm_segsize)) { @@ -378,8 +378,8 @@ void ssl_scache_shmcb_init(server_rec *s, apr_pool_t *p) ap_log_error(APLOG_MARK, APLOG_INFO, 0, s, "Shared memory session cache initialised"); - /* - * Success ... + /* + * Success ... */ mc->tSessionCacheDataTable = shm_segment; return; @@ -509,9 +509,9 @@ void ssl_scache_shmcb_status(request_rec *r, int flags, apr_pool_t *p) (int)(average_expiry - now), (int) (min_expiry - now), (int)(max_expiry - now)); else - ap_rprintf(r, "expiry threshold: Calculation Error!" + ap_rprintf(r, "expiry threshold: Calculation Error!" "
    "); - + } ap_rprintf(r, "index usage: %d%%, cache usage: %d%%" "
    ", index_pct, cache_pct); @@ -533,7 +533,7 @@ void ssl_scache_shmcb_status(request_rec *r, int flags, apr_pool_t *p) /* ** -** Memory manipulation and low-level cache operations +** Memory manipulation and low-level cache operations ** */ @@ -546,7 +546,7 @@ static BOOL shmcb_init_memory( SHMCBCache cache; unsigned int temp, loop, granularity; - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "entered shmcb_init_memory()"); /* Calculate some sizes... */ @@ -784,7 +784,7 @@ static BOOL shmcb_remove_session( } -/* +/* ** ** Weirdo cyclic buffer functions ** @@ -1015,7 +1015,7 @@ static unsigned int shmcb_expire_division( shmcb_set_safe_uint(queue->first_pos, new_pos); /* peek to the start of the next session */ idx = shmcb_get_index(queue, new_pos); - /* We can use shmcb_cyclic_space because we've guaranteed + /* We can use shmcb_cyclic_space because we've guaranteed * we don't fit the ambiguous full/empty case. */ shmcb_set_safe_uint(cache->pos_count, shmcb_get_safe_uint(cache->pos_count) - @@ -1314,7 +1314,7 @@ static BOOL shmcb_remove_session_id( session_id_length = SSL_SESSION_get_session_id_length(pSession); session_id = SSL_SESSION_get_session_id(pSession); - if ((session_id_length == idlen) + if ((session_id_length == idlen) && (memcmp(id, session_id, idlen) == 0)) { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "a match!"); diff --git a/modules/ssl/ssl_util.c b/modules/ssl/ssl_util.c index edfcb09643..92289bdd02 100644 --- a/modules/ssl/ssl_util.c +++ b/modules/ssl/ssl_util.c @@ -66,12 +66,12 @@ apr_file_t *ssl_util_ppopen(server_rec *s, apr_pool_t *p, const char *cmd, apr_procattr_t *procattr; apr_proc_t *proc; - if (apr_procattr_create(&procattr, p) != APR_SUCCESS) + if (apr_procattr_create(&procattr, p) != APR_SUCCESS) return NULL; - if (apr_procattr_io_set(procattr, APR_FULL_BLOCK, APR_FULL_BLOCK, + if (apr_procattr_io_set(procattr, APR_FULL_BLOCK, APR_FULL_BLOCK, APR_FULL_BLOCK) != APR_SUCCESS) return NULL; - if (apr_procattr_dir_set(procattr, + if (apr_procattr_dir_set(procattr, ap_make_dirstr_parent(p, cmd)) != APR_SUCCESS) return NULL; if (apr_procattr_cmdtype_set(procattr, APR_PROGRAM) != APR_SUCCESS) @@ -122,7 +122,7 @@ BOOL ssl_util_path_check(ssl_pathcheck_t pcm, const char *path, apr_pool_t *p) if (path == NULL) return FALSE; - if (pcm & SSL_PCM_EXISTS && apr_stat(&finfo, path, + if (pcm & SSL_PCM_EXISTS && apr_stat(&finfo, path, APR_FINFO_TYPE|APR_FINFO_SIZE, p) != 0) return FALSE; if (pcm & SSL_PCM_ISREG && finfo.filetype != APR_REG) @@ -134,20 +134,20 @@ BOOL ssl_util_path_check(ssl_pathcheck_t pcm, const char *path, apr_pool_t *p) return TRUE; } -ssl_algo_t ssl_util_algotypeof(X509 *pCert, EVP_PKEY *pKey) +ssl_algo_t ssl_util_algotypeof(X509 *pCert, EVP_PKEY *pKey) { ssl_algo_t t; EVP_PKEY *pFreeKey = NULL; - + t = SSL_ALGO_UNKNOWN; if (pCert != NULL) pFreeKey = pKey = X509_get_pubkey(pCert); if (pKey != NULL) { switch (EVP_PKEY_key_type(pKey)) { - case EVP_PKEY_RSA: + case EVP_PKEY_RSA: t = SSL_ALGO_RSA; break; - case EVP_PKEY_DSA: + case EVP_PKEY_DSA: t = SSL_ALGO_DSA; break; default: @@ -162,16 +162,16 @@ ssl_algo_t ssl_util_algotypeof(X509 *pCert, EVP_PKEY *pKey) return t; } -char *ssl_util_algotypestr(ssl_algo_t t) +char *ssl_util_algotypestr(ssl_algo_t t) { char *cp; cp = "UNKNOWN"; switch (t) { - case SSL_ALGO_RSA: + case SSL_ALGO_RSA: cp = "RSA"; break; - case SSL_ALGO_DSA: + case SSL_ALGO_DSA: cp = "DSA"; break; default: @@ -307,8 +307,8 @@ static void ssl_util_thr_lock(int mode, int type, static unsigned long ssl_util_thr_id(void) { - /* OpenSSL needs this to return an unsigned long. On OS/390, the pthread - * id is a structure twice that big. Use the TCB pointer instead as a + /* OpenSSL needs this to return an unsigned long. On OS/390, the pthread + * id is a structure twice that big. Use the TCB pointer instead as a * unique unsigned long. */ #ifdef __MVS__ @@ -328,7 +328,7 @@ static apr_status_t ssl_util_thread_cleanup(void *data) CRYPTO_set_locking_callback(NULL); CRYPTO_set_id_callback(NULL); - /* Let the registered mutex cleanups do their own thing + /* Let the registered mutex cleanups do their own thing */ return APR_SUCCESS; } diff --git a/modules/ssl/ssl_util_ssl.c b/modules/ssl/ssl_util_ssl.c index 9a464c2560..cbce6f30be 100644 --- a/modules/ssl/ssl_util_ssl.c +++ b/modules/ssl/ssl_util_ssl.c @@ -90,7 +90,7 @@ X509 *SSL_read_X509(char* filename, X509 **x509, modssl_read_bio_cb_fn *cb) /* 2. try DER+Base64 */ if ((bioS=BIO_new_file(filename, "r")) == NULL) return NULL; - + if ((bioF = BIO_new(BIO_f_base64())) == NULL) { BIO_free(bioS); return NULL; @@ -119,8 +119,8 @@ X509 *SSL_read_X509(char* filename, X509 **x509, modssl_read_bio_cb_fn *cb) static EVP_PKEY *d2i_PrivateKey_bio(BIO *bio, EVP_PKEY **key) { return ((EVP_PKEY *)ASN1_d2i_bio( - (char *(*)())EVP_PKEY_new, - (char *(*)())d2i_PrivateKey, + (char *(*)())EVP_PKEY_new, + (char *(*)())d2i_PrivateKey, (bio), (unsigned char **)(key))); } #endif @@ -256,7 +256,7 @@ char *SSL_make_ciphersuite(apr_pool_t *p, SSL *ssl) char *cpCipherSuite; char *cp; - if (ssl == NULL) + if (ssl == NULL) return ""; if ((sk = (STACK_OF(SSL_CIPHER) *)SSL_get_ciphers(ssl)) == NULL) return ""; @@ -298,7 +298,7 @@ BOOL SSL_X509_isSGC(X509 *cert) BOOL is_sgc; int idx; int i; - + is_sgc = FALSE; idx = X509_get_ext_by_NID(cert, NID_ext_key_usage, -1); if (idx >= 0) { @@ -328,7 +328,7 @@ BOOL SSL_X509_getBC(X509 *cert, int *ca, int *pathlen) int idx; BIGNUM *bn = NULL; char *cp; - + if ((idx = X509_get_ext_by_NID(cert, NID_basic_constraints, -1)) < 0) return FALSE; ext = X509_get_ext(cert, idx); @@ -447,7 +447,7 @@ BOOL SSL_X509_INFO_load_path(apr_pool_t *ptemp, apr_dir_close(dir); return ok; -} +} /* _________________________________________________________________ ** @@ -455,7 +455,7 @@ BOOL SSL_X509_INFO_load_path(apr_pool_t *ptemp, ** _________________________________________________________________ */ -/* +/* * Read a file that optionally contains the server certificate in PEM * format, possibly followed by a sequence of CA certificates that * should be sent to the peer in the SSL Certificate message. @@ -492,7 +492,7 @@ int SSL_CTX_use_certificate_chain( /* create new extra chain by loading the certs */ n = 0; while ((x509 = modssl_PEM_read_bio_X509(bio, NULL, cb, NULL)) != NULL) { - if (!SSL_CTX_add_extra_chain_cert(ctx, x509)) { + if (!SSL_CTX_add_extra_chain_cert(ctx, x509)) { X509_free(x509); BIO_free(bio); return -1; @@ -501,7 +501,7 @@ int SSL_CTX_use_certificate_chain( } /* Make sure that only the error is just an EOF */ if ((err = ERR_peek_error()) > 0) { - if (!( ERR_GET_LIB(err) == ERR_LIB_PEM + if (!( ERR_GET_LIB(err) == ERR_LIB_PEM && ERR_GET_REASON(err) == PEM_R_NO_START_LINE)) { BIO_free(bio); return -1; -- cgit v1.2.1