* Licensed 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
* Licensed 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.
* 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.
-static void *ngx_http_office_hours_create_conf(ngx_conf_t * cf);
-static char *ngx_http_office_hours_merge_conf(ngx_conf_t * cf, void *parent, void *child);
+static void *ngx_http_office_hours_create_conf(ngx_conf_t * cf);
+static char *ngx_http_office_hours_merge_conf(ngx_conf_t * cf, void *parent, void *child);
- ngx_string("office_hours"),
- NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_CONF_1MORE,
- ngx_http_office_hours,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_office_hours_conf_t, office_hours),
- NULL
+ ngx_string("office_hours"),
+ NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_CONF_1MORE,
+ ngx_http_office_hours,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_office_hours_conf_t, office_hours),
+ NULL
ngx_module_t ngx_http_office_hours_filter_module = {
NGX_MODULE_V1, //Module Version
ngx_module_t ngx_http_office_hours_filter_module = {
NGX_MODULE_V1, //Module Version
- & ngx_http_office_hours_filter_module_ctx, //Module context
- ngx_http_office_hours_commands, //Module commands
- NGX_HTTP_MODULE, //Module Type
- NULL, //Initialize Master
- NULL, //Initialize Module
- NULL, //Initialize Process
- NULL, //Initialize Thread
- NULL, //Exit Thread
- NULL, //Exit Process
- NULL, //Exit Master
- NGX_MODULE_V1_PADDING
+ & ngx_http_office_hours_filter_module_ctx, //Module context
+ ngx_http_office_hours_commands, //Module commands
+ NGX_HTTP_MODULE, //Module Type
+ NULL, //Initialize Master
+ NULL, //Initialize Module
+ NULL, //Initialize Process
+ NULL, //Initialize Thread
+ NULL, //Exit Thread
+ NULL, //Exit Process
+ NULL, //Exit Master
+ NGX_MODULE_V1_PADDING
conf = ngx_http_get_module_loc_conf(r, ngx_http_office_hours_filter_module);
if (conf->office_hours == NULL) {
conf = ngx_http_get_module_loc_conf(r, ngx_http_office_hours_filter_module);
if (conf->office_hours == NULL) {
- ngx_log_error(NGX_LOG_DEBUG, r->connection->log, 0, "Within office hours");
+ ngx_log_error(NGX_LOG_DEBUG, r->connection->log, 0, "Within office hours");
ngx_log_error(NGX_LOG_DEBUG, r->connection->log, 0, "Outside office hours");
hours = conf->office_hours->elts;
for (i = 0; i < conf->office_hours->nelts; ++i) {
ngx_log_error(NGX_LOG_DEBUG, r->connection->log, 0, "Outside office hours");
hours = conf->office_hours->elts;
for (i = 0; i < conf->office_hours->nelts; ++i) {
- ngx_log_error(NGX_LOG_DEBUG, r->connection->log, 0, (const char *)hours[i].data);
+ ngx_log_error(NGX_LOG_DEBUG, r->connection->log, 0, (const char *)hours[i].data);
- // offset, and if the
- pointer is unset it creates a new one.
- //
- //(The first element is the directive itself, so we should be
- // offset by 1)
- office_hours = (ngx_array_t **) (conf_structure + cmd->offset);
+ // offset, and if the
+ pointer is unset it creates a new one.
+ //
+ //(The first element is the directive itself, so we should be
+ // offset by 1)
+ office_hours = (ngx_array_t **) (conf_structure + cmd->offset);
ngx_http_next_body_filter = ngx_http_top_body_filter;
ngx_http_top_body_filter = ngx_http_office_hours_body_filter;
ngx_http_next_body_filter = ngx_http_top_body_filter;
ngx_http_top_body_filter = ngx_http_office_hours_body_filter;