Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added push_message_buffer_length setting

  • Loading branch information...
commit c75c092e5921ed1676d1ac7757352acfe1d50242 1 parent edcd100
@slact authored
Showing with 34 additions and 0 deletions.
  1. +7 −0 README
  2. +1 −0  changelog.txt
  3. +26 −0 src/ngx_http_push_module_setup.c
View
7 README
@@ -75,6 +75,13 @@ push_max_message_buffer_length [ number ]
The maximum number of messages to store per channel. A channel's message
buffer will retain at most this many most recent messages.
+push_message_buffer_length [ number ]
+ default: none
+ context: http, server, location
+ The exact number of messages to store per channel. Sets both
+ push_max_message_buffer_length and push_min_message_buffer_length to this
+ value.
+
push_min_message_recipients [ number ]
default: 0
context: http, server, location
View
1  changelog.txt
@@ -1,3 +1,4 @@
+ feature: added push_message_buffer_length setting, which sets push_message_max_buffer_length and push_message_min_buffer_length at once.
fix: publisher channel info text/json response now uses double quotes instead of single.
fix: interprocess messages were not removed from shared memory correctly, causing weird errors
0.68 (Nov. 5 2009)
View
26 src/ngx_http_push_module_setup.c
@@ -228,6 +228,25 @@ static void ngx_http_push_exit_master(ngx_cycle_t *cycle) {
ngx_shmtx_unlock(&shpool->mutex);
}
+static char *ngx_http_push_set_message_buffer_length(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) {
+ char *p = conf;
+ ngx_int_t *min, *max;
+ ngx_str_t *value;
+ ngx_int_t intval;
+ min = (ngx_int_t *) (p + offsetof(ngx_http_push_loc_conf_t, min_messages));
+ max = (ngx_int_t *) (p + offsetof(ngx_http_push_loc_conf_t, max_messages));
+ if(*min != NGX_CONF_UNSET || *max != NGX_CONF_UNSET) {
+ return "is duplicate";
+ }
+ value = cf->args->elts;
+ if((intval = ngx_atoi(value[1].data, value[1].len))==NGX_ERROR) {
+ return "invalid number";
+ }
+ *min = intval;
+ *max = intval;
+
+ return NGX_CONF_OK;
+}
static ngx_command_t ngx_http_push_commands[] = {
@@ -260,6 +279,13 @@ static ngx_command_t ngx_http_push_commands[] = {
offsetof(ngx_http_push_loc_conf_t, max_messages),
NULL },
+ { ngx_string("push_message_buffer_length"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_http_push_set_message_buffer_length,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ 0,
+ NULL },
+
{ ngx_string("push_min_message_recipients"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
ngx_conf_set_num_slot,
Please sign in to comment.
Something went wrong with that request. Please try again.