util_fcgi.c revision b2c17021012bc4f7cd8e374c6bd72b926737320f
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "httpd.h"
#include "http_core.h"
#include "http_log.h"
#include "util_fcgi.h"
/* we know core's module_index is 0 */
unsigned char a[])
{
a[AP_FCGI_HDR_VERSION_OFFSET] = h->version;
a[AP_FCGI_HDR_TYPE_OFFSET] = h->type;
a[AP_FCGI_HDR_RESERVED_OFFSET] = h->reserved;
}
unsigned char a[])
{
h->version = a[AP_FCGI_HDR_VERSION_OFFSET];
h->type = a[AP_FCGI_HDR_TYPE_OFFSET];
h->reserved = a[AP_FCGI_HDR_RESERVED_OFFSET];
}
unsigned char *type,
unsigned char *padding_len,
unsigned char a[])
{
*type = a[AP_FCGI_HDR_TYPE_OFFSET];
}
unsigned char a[])
{
a[AP_FCGI_BRB_ROLEB1_OFFSET] = h->roleB1;
a[AP_FCGI_BRB_ROLEB0_OFFSET] = h->roleB0;
a[AP_FCGI_BRB_FLAGS_OFFSET] = h->flags;
a[AP_FCGI_BRB_RESERVED0_OFFSET] = h->reserved[0];
}
unsigned char type,
unsigned char padding_len)
{
}
int role,
unsigned char flags)
{
}
int *starting_elem)
{
const apr_array_header_t *envarr;
const apr_table_entry_t *elts;
int i;
if (maxlen > AP_FCGI_MAX_CONTENT_LEN) {
}
/* envlen - speculative, may overflow the limit
* actualenvlen - len required without overflowing
*/
envlen = actualenvlen = 0;
(*starting_elem)++;
i++;
continue;
}
if (keylen >> 7 == 0) {
envlen += 1;
}
else {
envlen += 4;
}
if (vallen >> 7 == 0) {
envlen += 1;
}
else {
envlen += 4;
}
break;
}
(*starting_elem)++;
i++;
}
return actualenvlen;
}
void *buffer,
int *starting_elem)
{
const apr_array_header_t *envarr;
const apr_table_entry_t *elts;
char *itr;
int i;
(*starting_elem)++;
i++;
continue;
}
if (keylen >> 7 == 0) {
if (buflen < 1) {
break;
}
itr += 1;
buflen -= 1;
}
else {
if (buflen < 4) {
break;
}
itr += 4;
buflen -= 4;
}
if (vallen >> 7 == 0) {
if (buflen < 1) {
break;
}
itr += 1;
buflen -= 1;
}
else {
if (buflen < 4) {
break;
}
itr += 4;
buflen -= 4;
}
break;
}
break;
}
(*starting_elem)++;
i++;
break; /* filled up predicted space, as expected */
}
(*starting_elem)++;
i++;
}
if (rv != APR_SUCCESS) {
"ap_fcgi_encode_env: out of space "
"encoding environment");
}
return rv;
}