}
/* eliminate the '.' if there is one */
- if (*ext == '.')
+ if (*ext == '.') {
++ext;
+ }
/* check if we have a registered command for the extension*/
new_cmd = apr_table_get(d->file_type_handlers, ext);
*cmd = apr_pstrcat (p, new_cmd, " ", cmd_only, NULL);
/* 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;
+ }
}
/* Tokenize the full command string into its arguments */
apr_uint32_t read;
int res;
- if(strcmp(r->handler, "isapi-isa")
+ if (strcmp(r->handler, "isapi-isa")
&& strcmp(r->handler, "isapi-handler")) {
/* Hang on to the isapi-isa for compatibility with older docs
* (wtf did '-isa' mean in the first place?) but introduce
"cache: Removing url %s from the cache", h->cache_obj->key);
/* for each specified cache type, delete the URL */
- while(list) {
+ while (list) {
list->provider->remove_url(h, r);
list = list->next;
}
return NULL;
}
- while(dp) {
+ while (dp) {
val.dsize += dav_size_direct(dp);
dp = dp->next;
}
- while(ip) {
+ while (ip) {
val.dsize += dav_size_indirect(ip);
ip = ip->next;
}
dp = direct;
ip = indirect;
- while(dp) {
+ while (dp) {
/* Direct lock - lock_discovery struct follows */
*ptr++ = DAV_LOCK_DIRECT;
memcpy(ptr, dp, sizeof(dp->f)); /* Fixed portion of struct */
dp = dp->next;
}
- while(ip) {
+ while (ip) {
/* Indirect lock prefix */
*ptr++ = DAV_LOCK_INDIRECT;
* 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_BRIGADE_INSERT_TAIL(pbbOut, pbktIn);
break;
/**
* 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;
request_rec *r = f->r;
buffer_ctx *ctx = f->ctx;
ctx = f->ctx = apr_pcalloc(r->pool, sizeof(*ctx));
ctx->bb = apr_brigade_create(r->pool, f->c->bucket_alloc);
ctx->conf = ap_get_module_config(f->r->per_dir_config, &buffer_module);
-
}
/* Do nothing if asked to filter nothing. */
* Buffer buckets being read from the input filter stack.
*/
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_status_t rv;
buffer_ctx *ctx = f->ctx;
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));
new->size_set = 0; /* unset */
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 *add = (buffer_conf *) addv;
buffer_conf *base = (buffer_conf *) basev;
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;
if (APR_SUCCESS != apr_strtoff(&(conf->size), arg, NULL, 10) || conf->size
set_buffer_size, NULL, ACCESS_CONF,
"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_FTYPE_CONTENT_SET);
ap_register_input_filter(bufferFilterName, buffer_in_filter, NULL,
}
else {
/* Find provider */
- for (provider = filter->providers; provider; provider = provider->next){
+ for (provider = filter->providers; provider; provider = provider->next) {
if (!strcasecmp(provider->frec->name, pname)) {
break;
}
d = apr_pstrdup(ctx->pool, decoding);
token = apr_strtok(d, ", \t", &last);
- while(token) {
+ while (token) {
if (!strcasecmp(token, "none")) {
/* do nothing */
}
e = apr_pstrdup(ctx->pool, encoding);
token = apr_strtok(e, ", \t", &last);
- while(token) {
+ while (token) {
if (!strcasecmp(token, "none")) {
/* do nothing */
}
d = apr_pstrdup(ctx->pool, decoding);
token = apr_strtok(d, ", \t", &last);
- while(token) {
+ while (token) {
if (!strcasecmp(token, "none")) {
/* do nothing */
}
e = apr_pstrdup(ctx->pool, encoding);
token = apr_strtok(e, ", \t", &last);
- while(token) {
+ while (token) {
if (!strcasecmp(token, "none")) {
/* do nothing */
}
} /* switch(ctx->state) */
- } /* while(brigade) */
+ } /* while (brigade) */
/* End of stream. Final cleanup */
if (intern->seen_eos) {
*/
static int include_post_config(apr_pool_t *p, apr_pool_t *plog,
- apr_pool_t *ptemp, server_rec *s)
+ apr_pool_t *ptemp, server_rec *s)
{
include_handlers = apr_hash_make(p);
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("set", handle_set);
ssi_pfn_register("else", handle_else);
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;
*val = strtol(arg, &endptr, 10);
* been removed from the body during storage. We need to change the request
* 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;
request_rec *r = f->r;
apr_bucket_brigade *kept_body = r->kept_body;
return (NULL);
}
- if((autoindex_opts & SHOW_FORBIDDEN)
+ if ((autoindex_opts & SHOW_FORBIDDEN)
&& (rr->status == HTTP_UNAUTHORIZED || rr->status == HTTP_FORBIDDEN)) {
show_forbidden = 1;
}
util_ldap_search_node_free(cache, newnode);
return NULL;
}
- if(node->bindpw) {
- if(!(newnode->bindpw = util_ald_strdup(cache, node->bindpw))) {
+ if (node->bindpw) {
+ if (!(newnode->bindpw = util_ald_strdup(cache, node->bindpw))) {
util_ldap_search_node_free(cache, newnode);
return NULL;
}
cmp_result = apr_itoa(r->pool, node->result);
}
- if(node->subgroupList) {
+ if (node->subgroupList) {
sub_groups_val = "Yes";
}
else {
sub_groups_val = "No";
}
- if(node->sgl_processed) {
+ if (node->sgl_processed) {
sub_groups_checked = "Yes";
}
else {
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);
lua_pushstring(L, cfg->root_path);
return 1;
ndots = 0;
dots[ndots++] = name-1; /* slightly naughty */
- for (p = name; *p; ++p){
+ for (p = name; *p; ++p) {
if (*p == '.' && ndots < MAXDOTS) {
dots[ndots++] = p;
}
* Note that the strchr function below checks for \012 instead of '\n'
* 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_status_t status;
status = apr_socket_recv(sock, buffer+i, &j);
static int ImportLogTransaction(request_rec *r)
{
- if(pfn)
+ if (pfn)
return pfn(r->the_request);
return DECLINED;
}
static void ImportFnRetrieve(void)
{
- pfn=APR_RETRIEVE_OPTIONAL_FN(TestOptionalFn);
+ pfn = APR_RETRIEVE_OPTIONAL_FN(TestOptionalFn);
}
static void ImportRegisterHooks(apr_pool_t *p)