1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-05 16:55:50 +03:00

Fix some style issues on files that can easily be synch'ed with 2.4.x

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1705983 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Christophe Jaillet
2015-09-30 08:35:35 +00:00
parent 844e85ad0d
commit 68131d85a4
16 changed files with 46 additions and 36 deletions

View File

@@ -137,8 +137,9 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
} }
/* eliminate the '.' if there is one */ /* eliminate the '.' if there is one */
if (*ext == '.') if (*ext == '.') {
++ext; ++ext;
}
/* check if we have a registered command for the extension*/ /* check if we have a registered command for the extension*/
new_cmd = apr_table_get(d->file_type_handlers, ext); new_cmd = apr_table_get(d->file_type_handlers, ext);
@@ -154,9 +155,10 @@ static apr_status_t ap_cgi_build_command(const char **cmd, const char ***argv,
*cmd = apr_pstrcat (p, new_cmd, " ", cmd_only, NULL); *cmd = apr_pstrcat (p, new_cmd, " ", cmd_only, NULL);
/* Run in its own address space if specified */ /* Run in its own address space if specified */
if(apr_table_get(d->file_handler_mode, ext)) if (apr_table_get(d->file_handler_mode, ext)) {
e_info->addrspace = 1; e_info->addrspace = 1;
} }
}
/* Tokenize the full command string into its arguments */ /* Tokenize the full command string into its arguments */
apr_tokenize_to_argv(*cmd, (char***)argv, p); apr_tokenize_to_argv(*cmd, (char***)argv, p);

View File

@@ -1415,7 +1415,7 @@ static apr_status_t isapi_handler (request_rec *r)
apr_uint32_t read; apr_uint32_t read;
int res; int res;
if(strcmp(r->handler, "isapi-isa") if (strcmp(r->handler, "isapi-isa")
&& strcmp(r->handler, "isapi-handler")) { && strcmp(r->handler, "isapi-handler")) {
/* Hang on to the isapi-isa for compatibility with older docs /* Hang on to the isapi-isa for compatibility with older docs
* (wtf did '-isa' mean in the first place?) but introduce * (wtf did '-isa' mean in the first place?) but introduce

View File

@@ -50,7 +50,7 @@ int cache_remove_url(cache_request_rec *cache, request_rec *r)
"cache: Removing url %s from the cache", h->cache_obj->key); "cache: Removing url %s from the cache", h->cache_obj->key);
/* for each specified cache type, delete the URL */ /* for each specified cache type, delete the URL */
while(list) { while (list) {
list->provider->remove_url(h, r); list->provider->remove_url(h, r);
list = list->next; list = list->next;
} }

View File

@@ -465,11 +465,11 @@ static dav_error * dav_generic_save_lock_record(dav_lockdb *lockdb,
return NULL; return NULL;
} }
while(dp) { while (dp) {
val.dsize += dav_size_direct(dp); val.dsize += dav_size_direct(dp);
dp = dp->next; dp = dp->next;
} }
while(ip) { while (ip) {
val.dsize += dav_size_indirect(ip); val.dsize += dav_size_indirect(ip);
ip = ip->next; ip = ip->next;
} }
@@ -480,7 +480,7 @@ static dav_error * dav_generic_save_lock_record(dav_lockdb *lockdb,
dp = direct; dp = direct;
ip = indirect; ip = indirect;
while(dp) { while (dp) {
/* Direct lock - lock_discovery struct follows */ /* Direct lock - lock_discovery struct follows */
*ptr++ = DAV_LOCK_DIRECT; *ptr++ = DAV_LOCK_DIRECT;
memcpy(ptr, dp, sizeof(dp->f)); /* Fixed portion of struct */ memcpy(ptr, dp, sizeof(dp->f)); /* Fixed portion of struct */
@@ -505,7 +505,7 @@ static dav_error * dav_generic_save_lock_record(dav_lockdb *lockdb,
dp = dp->next; dp = dp->next;
} }
while(ip) { while (ip) {
/* Indirect lock prefix */ /* Indirect lock prefix */
*ptr++ = DAV_LOCK_INDIRECT; *ptr++ = DAV_LOCK_INDIRECT;

View File

@@ -99,7 +99,7 @@ static apr_status_t CaseFilterInFilter(ap_filter_t *f,
* for a file or socket buffer, for example... * for a file or socket buffer, for example...
*/ */
if(APR_BUCKET_IS_EOS(pbktIn)) { if (APR_BUCKET_IS_EOS(pbktIn)) {
APR_BUCKET_REMOVE(pbktIn); APR_BUCKET_REMOVE(pbktIn);
APR_BRIGADE_INSERT_TAIL(pbbOut, pbktIn); APR_BRIGADE_INSERT_TAIL(pbbOut, pbktIn);
break; break;

View File

@@ -52,7 +52,8 @@ typedef struct buffer_ctx {
/** /**
* Buffer buckets being written to the output filter stack. * Buffer buckets being written to the output filter stack.
*/ */
static apr_status_t buffer_out_filter(ap_filter_t *f, apr_bucket_brigade *bb) { static apr_status_t buffer_out_filter(ap_filter_t *f, apr_bucket_brigade *bb)
{
apr_bucket *e; apr_bucket *e;
request_rec *r = f->r; request_rec *r = f->r;
buffer_ctx *ctx = f->ctx; buffer_ctx *ctx = f->ctx;
@@ -74,7 +75,6 @@ static apr_status_t buffer_out_filter(ap_filter_t *f, apr_bucket_brigade *bb) {
ctx = f->ctx = apr_pcalloc(r->pool, sizeof(*ctx)); ctx = f->ctx = apr_pcalloc(r->pool, sizeof(*ctx));
ctx->bb = apr_brigade_create(r->pool, f->c->bucket_alloc); ctx->bb = apr_brigade_create(r->pool, f->c->bucket_alloc);
ctx->conf = ap_get_module_config(f->r->per_dir_config, &buffer_module); ctx->conf = ap_get_module_config(f->r->per_dir_config, &buffer_module);
} }
/* Do nothing if asked to filter nothing. */ /* Do nothing if asked to filter nothing. */
@@ -187,7 +187,8 @@ static apr_status_t buffer_out_filter(ap_filter_t *f, apr_bucket_brigade *bb) {
* Buffer buckets being read from the input filter stack. * Buffer buckets being read from the input filter stack.
*/ */
static apr_status_t buffer_in_filter(ap_filter_t *f, apr_bucket_brigade *bb, static apr_status_t buffer_in_filter(ap_filter_t *f, apr_bucket_brigade *bb,
ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes) { ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes)
{
apr_bucket *e, *after; apr_bucket *e, *after;
apr_status_t rv; apr_status_t rv;
buffer_ctx *ctx = f->ctx; buffer_ctx *ctx = f->ctx;
@@ -294,7 +295,8 @@ static apr_status_t buffer_in_filter(ap_filter_t *f, apr_bucket_brigade *bb,
return APR_SUCCESS; return APR_SUCCESS;
} }
static void *create_buffer_config(apr_pool_t *p, char *dummy) { static void *create_buffer_config(apr_pool_t *p, char *dummy)
{
buffer_conf *new = (buffer_conf *) apr_pcalloc(p, sizeof(buffer_conf)); buffer_conf *new = (buffer_conf *) apr_pcalloc(p, sizeof(buffer_conf));
new->size_set = 0; /* unset */ new->size_set = 0; /* unset */
@@ -303,7 +305,8 @@ static void *create_buffer_config(apr_pool_t *p, char *dummy) {
return (void *) new; return (void *) new;
} }
static void *merge_buffer_config(apr_pool_t *p, void *basev, void *addv) { static void *merge_buffer_config(apr_pool_t *p, void *basev, void *addv)
{
buffer_conf *new = (buffer_conf *) apr_pcalloc(p, sizeof(buffer_conf)); buffer_conf *new = (buffer_conf *) apr_pcalloc(p, sizeof(buffer_conf));
buffer_conf *add = (buffer_conf *) addv; buffer_conf *add = (buffer_conf *) addv;
buffer_conf *base = (buffer_conf *) basev; buffer_conf *base = (buffer_conf *) basev;
@@ -314,7 +317,8 @@ static void *merge_buffer_config(apr_pool_t *p, void *basev, void *addv) {
return new; return new;
} }
static const char *set_buffer_size(cmd_parms *cmd, void *dconf, const char *arg) { static const char *set_buffer_size(cmd_parms *cmd, void *dconf, const char *arg)
{
buffer_conf *conf = dconf; buffer_conf *conf = dconf;
if (APR_SUCCESS != apr_strtoff(&(conf->size), arg, NULL, 10) || conf->size if (APR_SUCCESS != apr_strtoff(&(conf->size), arg, NULL, 10) || conf->size
@@ -330,7 +334,8 @@ static const command_rec buffer_cmds[] = { AP_INIT_TAKE1("BufferSize",
set_buffer_size, NULL, ACCESS_CONF, set_buffer_size, NULL, ACCESS_CONF,
"Maximum size of the buffer used by the buffer filter"), { NULL } }; "Maximum size of the buffer used by the buffer filter"), { NULL } };
static void register_hooks(apr_pool_t *p) { static void register_hooks(apr_pool_t *p)
{
ap_register_output_filter(bufferFilterName, buffer_out_filter, NULL, ap_register_output_filter(bufferFilterName, buffer_out_filter, NULL,
AP_FTYPE_CONTENT_SET); AP_FTYPE_CONTENT_SET);
ap_register_input_filter(bufferFilterName, buffer_in_filter, NULL, ap_register_input_filter(bufferFilterName, buffer_in_filter, NULL,

View File

@@ -351,7 +351,7 @@ static const char *filter_protocol(cmd_parms *cmd, void *CFG, const char *fname,
} }
else { else {
/* Find provider */ /* Find provider */
for (provider = filter->providers; provider; provider = provider->next){ for (provider = filter->providers; provider; provider = provider->next) {
if (!strcasecmp(provider->frec->name, pname)) { if (!strcasecmp(provider->frec->name, pname)) {
break; break;
} }

View File

@@ -1950,7 +1950,7 @@ static apr_status_t handle_echo(include_ctx_t *ctx, ap_filter_t *f,
d = apr_pstrdup(ctx->pool, decoding); d = apr_pstrdup(ctx->pool, decoding);
token = apr_strtok(d, ", \t", &last); token = apr_strtok(d, ", \t", &last);
while(token) { while (token) {
if (!strcasecmp(token, "none")) { if (!strcasecmp(token, "none")) {
/* do nothing */ /* do nothing */
} }
@@ -1986,7 +1986,7 @@ static apr_status_t handle_echo(include_ctx_t *ctx, ap_filter_t *f,
e = apr_pstrdup(ctx->pool, encoding); e = apr_pstrdup(ctx->pool, encoding);
token = apr_strtok(e, ", \t", &last); token = apr_strtok(e, ", \t", &last);
while(token) { while (token) {
if (!strcasecmp(token, "none")) { if (!strcasecmp(token, "none")) {
/* do nothing */ /* do nothing */
} }
@@ -2588,7 +2588,7 @@ static apr_status_t handle_set(include_ctx_t *ctx, ap_filter_t *f,
d = apr_pstrdup(ctx->pool, decoding); d = apr_pstrdup(ctx->pool, decoding);
token = apr_strtok(d, ", \t", &last); token = apr_strtok(d, ", \t", &last);
while(token) { while (token) {
if (!strcasecmp(token, "none")) { if (!strcasecmp(token, "none")) {
/* do nothing */ /* do nothing */
} }
@@ -2624,7 +2624,7 @@ static apr_status_t handle_set(include_ctx_t *ctx, ap_filter_t *f,
e = apr_pstrdup(ctx->pool, encoding); e = apr_pstrdup(ctx->pool, encoding);
token = apr_strtok(e, ", \t", &last); token = apr_strtok(e, ", \t", &last);
while(token) { while (token) {
if (!strcasecmp(token, "none")) { if (!strcasecmp(token, "none")) {
/* do nothing */ /* do nothing */
} }
@@ -3726,7 +3726,7 @@ static apr_status_t send_parsed_content(ap_filter_t *f, apr_bucket_brigade *bb)
} /* switch(ctx->state) */ } /* switch(ctx->state) */
} /* while(brigade) */ } /* while (brigade) */
/* End of stream. Final cleanup */ /* End of stream. Final cleanup */
if (intern->seen_eos) { if (intern->seen_eos) {
@@ -4145,7 +4145,7 @@ static int include_post_config(apr_pool_t *p, apr_pool_t *plog,
ssi_pfn_register = APR_RETRIEVE_OPTIONAL_FN(ap_register_include_handler); ssi_pfn_register = APR_RETRIEVE_OPTIONAL_FN(ap_register_include_handler);
if(ssi_pfn_register) { if (ssi_pfn_register) {
ssi_pfn_register("if", handle_if); ssi_pfn_register("if", handle_if);
ssi_pfn_register("set", handle_set); ssi_pfn_register("set", handle_set);
ssi_pfn_register("else", handle_else); ssi_pfn_register("else", handle_else);

View File

@@ -479,7 +479,8 @@ static void *reqtimeout_merge_srv_config(apr_pool_t *p, void *base_, void *add_)
return cfg; return cfg;
} }
static const char *parse_int(apr_pool_t *p, const char *arg, int *val) { static const char *parse_int(apr_pool_t *p, const char *arg, int *val)
{
char *endptr; char *endptr;
*val = strtol(arg, &endptr, 10); *val = strtol(arg, &endptr, 10);

View File

@@ -178,7 +178,8 @@ typedef struct kept_body_filter_ctx {
* been removed from the body during storage. We need to change the request * been removed from the body during storage. We need to change the request
* from Transfer-Encoding: chunked to an explicit Content-Length. * from Transfer-Encoding: chunked to an explicit Content-Length.
*/ */
static int kept_body_filter_init(ap_filter_t *f) { static int kept_body_filter_init(ap_filter_t *f)
{
apr_off_t length = 0; apr_off_t length = 0;
request_rec *r = f->r; request_rec *r = f->r;
apr_bucket_brigade *kept_body = r->kept_body; apr_bucket_brigade *kept_body = r->kept_body;

View File

@@ -1336,7 +1336,7 @@ static struct ent *make_autoindex_entry(const apr_finfo_t *dirent,
return (NULL); return (NULL);
} }
if((autoindex_opts & SHOW_FORBIDDEN) if ((autoindex_opts & SHOW_FORBIDDEN)
&& (rr->status == HTTP_UNAUTHORIZED || rr->status == HTTP_FORBIDDEN)) { && (rr->status == HTTP_UNAUTHORIZED || rr->status == HTTP_FORBIDDEN)) {
show_forbidden = 1; show_forbidden = 1;
} }

View File

@@ -181,8 +181,8 @@ void *util_ldap_search_node_copy(util_ald_cache_t *cache, void *c)
util_ldap_search_node_free(cache, newnode); util_ldap_search_node_free(cache, newnode);
return NULL; return NULL;
} }
if(node->bindpw) { if (node->bindpw) {
if(!(newnode->bindpw = util_ald_strdup(cache, node->bindpw))) { if (!(newnode->bindpw = util_ald_strdup(cache, node->bindpw))) {
util_ldap_search_node_free(cache, newnode); util_ldap_search_node_free(cache, newnode);
return NULL; return NULL;
} }
@@ -305,14 +305,14 @@ void util_ldap_compare_node_display(request_rec *r, util_ald_cache_t *cache, voi
cmp_result = apr_itoa(r->pool, node->result); cmp_result = apr_itoa(r->pool, node->result);
} }
if(node->subgroupList) { if (node->subgroupList) {
sub_groups_val = "Yes"; sub_groups_val = "Yes";
} }
else { else {
sub_groups_val = "No"; sub_groups_val = "No";
} }
if(node->sgl_processed) { if (node->sgl_processed) {
sub_groups_checked = "Yes"; sub_groups_checked = "Yes";
} }
else { else {

View File

@@ -141,7 +141,8 @@ static int cfg_directory(lua_State *L)
return 1; return 1;
} }
/*static int cfg_root(lua_State *L) { /*static int cfg_root(lua_State *L)
{
ap_lua_dir_cfg *cfg = check_dir_config(L, 1); ap_lua_dir_cfg *cfg = check_dir_config(L, 1);
lua_pushstring(L, cfg->root_path); lua_pushstring(L, cfg->root_path);
return 1; return 1;

View File

@@ -269,7 +269,7 @@ static void vhost_alias_interpolate(request_rec *r, const char *name,
ndots = 0; ndots = 0;
dots[ndots++] = name-1; /* slightly naughty */ dots[ndots++] = name-1; /* slightly naughty */
for (p = name; *p; ++p){ for (p = name; *p; ++p) {
if (*p == '.' && ndots < MAXDOTS) { if (*p == '.' && ndots < MAXDOTS) {
dots[ndots++] = p; dots[ndots++] = p;
} }

View File

@@ -202,7 +202,7 @@ static apr_status_t rfc1413_query(apr_socket_t *sock, conn_rec *conn,
* Note that the strchr function below checks for \012 instead of '\n' * Note that the strchr function below checks for \012 instead of '\n'
* this allows it to work on both ASCII and EBCDIC machines. * this allows it to work on both ASCII and EBCDIC machines.
*/ */
while((cp = strchr(buffer, '\012')) == NULL && i < sizeof(buffer) - 1) { while ((cp = strchr(buffer, '\012')) == NULL && i < sizeof(buffer) - 1) {
apr_size_t j = sizeof(buffer) - 1 - i; apr_size_t j = sizeof(buffer) - 1 - i;
apr_status_t status; apr_status_t status;
status = apr_socket_recv(sock, buffer+i, &j); status = apr_socket_recv(sock, buffer+i, &j);

View File

@@ -27,14 +27,14 @@ static APR_OPTIONAL_FN_TYPE(TestOptionalFn) *pfn;
static int ImportLogTransaction(request_rec *r) static int ImportLogTransaction(request_rec *r)
{ {
if(pfn) if (pfn)
return pfn(r->the_request); return pfn(r->the_request);
return DECLINED; return DECLINED;
} }
static void ImportFnRetrieve(void) static void ImportFnRetrieve(void)
{ {
pfn=APR_RETRIEVE_OPTIONAL_FN(TestOptionalFn); pfn = APR_RETRIEVE_OPTIONAL_FN(TestOptionalFn);
} }
static void ImportRegisterHooks(apr_pool_t *p) static void ImportRegisterHooks(apr_pool_t *p)