Commit 1ac5c1f0 authored by Wandenberg Peixoto's avatar Wandenberg Peixoto

fix initial temp pool size to be 1024 multiple, the old value cause error when...

fix initial temp pool size to be 1024 multiple, the old value cause error when try to allocate more memory than the initial value
parent cd264714
...@@ -27,6 +27,6 @@ ...@@ -27,6 +27,6 @@
#define NGX_HTTP_PUSH_STREAM_MODULE_VERSION_H_ #define NGX_HTTP_PUSH_STREAM_MODULE_VERSION_H_
static const ngx_str_t NGX_HTTP_PUSH_STREAM_TAG = ngx_string("0.3.3"); static const ngx_str_t NGX_HTTP_PUSH_STREAM_TAG = ngx_string("0.3.3");
static const ngx_str_t NGX_HTTP_PUSH_STREAM_COMMIT = ngx_string("b4ad686386ea8c0738071f525207077db4bdb1de"); static const ngx_str_t NGX_HTTP_PUSH_STREAM_COMMIT = ngx_string("cd264714638b797333f70d8f4432901507e053c5");
#endif /* NGX_HTTP_PUSH_STREAM_MODULE_VERSION_H_ */ #endif /* NGX_HTTP_PUSH_STREAM_MODULE_VERSION_H_ */
...@@ -1097,7 +1097,7 @@ ngx_http_push_stream_add_request_context(ngx_http_request_t *r) ...@@ -1097,7 +1097,7 @@ ngx_http_push_stream_add_request_context(ngx_http_request_t *r)
return NULL; return NULL;
} }
if ((ctx->temp_pool = ngx_create_pool(NGX_MAX_ALLOC_FROM_POOL, ngx_cycle->log)) == NULL) { if ((ctx->temp_pool = ngx_create_pool(4096, r->connection->log)) == NULL) {
return NULL; return NULL;
} }
......
...@@ -255,7 +255,7 @@ ngx_http_push_stream_websocket_reading(ngx_http_request_t *r) ...@@ -255,7 +255,7 @@ ngx_http_push_stream_websocket_reading(ngx_http_request_t *r)
if (frame.payload_len > 0) { if (frame.payload_len > 0) {
//create a temporary pool to allocate temporary elements //create a temporary pool to allocate temporary elements
if ((temp_pool = ngx_create_pool(NGX_CYCLE_POOL_SIZE, r->connection->log)) == NULL) { if ((temp_pool = ngx_create_pool(4096, r->connection->log)) == NULL) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "push stream module: unable to allocate memory for temporary pool"); ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "push stream module: unable to allocate memory for temporary pool");
ngx_http_finalize_request(r, NGX_OK); ngx_http_finalize_request(r, NGX_OK);
ngx_destroy_pool(temp_pool); ngx_destroy_pool(temp_pool);
......
...@@ -6,7 +6,7 @@ class TestMeasureMemory < Test::Unit::TestCase ...@@ -6,7 +6,7 @@ class TestMeasureMemory < Test::Unit::TestCase
@@message_estimate_size = 174 @@message_estimate_size = 174
@@channel_estimate_size = 536 @@channel_estimate_size = 536
@@subscriber_estimate_size = 230 @@subscriber_estimate_size = 230
@@subscriber_estimate_system_size = 6780 @@subscriber_estimate_system_size = 6500
def global_configuration def global_configuration
@max_reserved_memory = "2m" @max_reserved_memory = "2m"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment