version 1.1.1.1, 2013/10/14 10:32:47
|
version 1.1.1.3, 2016/11/02 10:35:00
|
Line 1
|
Line 1
|
|
#include "first.h" |
|
|
#include "base.h" |
#include "base.h" |
#include "log.h" |
#include "log.h" |
#include "buffer.h" |
#include "buffer.h" |
Line 67 FREE_FUNC(mod_setenv_free) {
|
Line 69 FREE_FUNC(mod_setenv_free) {
|
for (i = 0; i < srv->config_context->used; i++) { |
for (i = 0; i < srv->config_context->used; i++) { |
plugin_config *s = p->config_storage[i]; |
plugin_config *s = p->config_storage[i]; |
|
|
|
if (NULL == s) continue; |
|
|
array_free(s->request_header); |
array_free(s->request_header); |
array_free(s->response_header); |
array_free(s->response_header); |
array_free(s->environment); |
array_free(s->environment); |
Line 96 SETDEFAULTS_FUNC(mod_setenv_set_defaults) {
|
Line 100 SETDEFAULTS_FUNC(mod_setenv_set_defaults) {
|
|
|
if (!p) return HANDLER_ERROR; |
if (!p) return HANDLER_ERROR; |
|
|
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *)); | p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *)); |
|
|
for (i = 0; i < srv->config_context->used; i++) { |
for (i = 0; i < srv->config_context->used; i++) { |
|
data_config const* config = (data_config const*)srv->config_context->data[i]; |
plugin_config *s; |
plugin_config *s; |
|
|
s = calloc(1, sizeof(plugin_config)); |
s = calloc(1, sizeof(plugin_config)); |
Line 112 SETDEFAULTS_FUNC(mod_setenv_set_defaults) {
|
Line 117 SETDEFAULTS_FUNC(mod_setenv_set_defaults) {
|
|
|
p->config_storage[i] = s; |
p->config_storage[i] = s; |
|
|
if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) { | if (0 != config_insert_values_global(srv, config->value, cv, i == 0 ? T_CONFIG_SCOPE_SERVER : T_CONFIG_SCOPE_CONNECTION)) { |
return HANDLER_ERROR; |
return HANDLER_ERROR; |
} |
} |
} |
} |
Line 185 URIHANDLER_FUNC(mod_setenv_uri_handler) {
|
Line 190 URIHANDLER_FUNC(mod_setenv_uri_handler) {
|
ds_dst = data_string_init(); |
ds_dst = data_string_init(); |
} |
} |
|
|
buffer_copy_string_buffer(ds_dst->key, ds->key); | buffer_copy_buffer(ds_dst->key, ds->key); |
buffer_copy_string_buffer(ds_dst->value, ds->value); | buffer_copy_buffer(ds_dst->value, ds->value); |
|
|
array_insert_unique(con->request.headers, (data_unset *)ds_dst); |
array_insert_unique(con->request.headers, (data_unset *)ds_dst); |
} |
} |
Line 199 URIHANDLER_FUNC(mod_setenv_uri_handler) {
|
Line 204 URIHANDLER_FUNC(mod_setenv_uri_handler) {
|
ds_dst = data_string_init(); |
ds_dst = data_string_init(); |
} |
} |
|
|
buffer_copy_string_buffer(ds_dst->key, ds->key); | buffer_copy_buffer(ds_dst->key, ds->key); |
buffer_copy_string_buffer(ds_dst->value, ds->value); | buffer_copy_buffer(ds_dst->value, ds->value); |
|
|
array_insert_unique(con->environment, (data_unset *)ds_dst); |
array_insert_unique(con->environment, (data_unset *)ds_dst); |
} |
} |