The error occurs when the response contains messages from different channels.
Example response:
PushStreamManager_0_onmessage_1442818993956([{"id":152806,"channel":"1","text":"[1,[974384,0,0,\"10:03:01\",\"test\",[1286374],{}]]","tag":"1","time":"Mon, 21 Sep 2015 07:03:01 GMT"}{"id":3,"channel":"9a3100empn3r38q7q3fkvqge91","text":"[1,[1,1,0,\"10:03:00\",\"test\",[1],{}]]","tag":"1","time":"Mon, 21 Sep 2015 07:03:00 GMT"},{"id":4,"channel":"9a3100empn3r38q7q3fkvqge91","text":"[1,[1,1,0,\"10:03:00\",\"test\",[1],{}]]","tag":"2","time":"Mon, 21 Sep 2015 07:03:00 GMT"}]);
If all messages on a single channel, everything works correctly.
nginx version: nginx/1.6.2
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt=-Wl,-z,relro --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --add-module=/root/nginx-1.6.2/debian/modules/nginx-auth-pam --add-module=/root/nginx-1.6.2/debian/modules/nginx-dav-ext-module --add-module=/root/nginx-1.6.2/debian/modules/nginx-echo --add-module=/root/nginx-1.6.2/debian/modules/nginx-upstream-fair --add-module=/root/nginx-1.6.2/debian/modules/ngx_http_substitutions_filter_module --add-module=/root/nginx-1.6.2/debian/modules/nginx-push-stream-module
http {
...
push_stream_shared_memory_size 100m;
push_stream_max_channel_id_length 50;
push_stream_max_messages_stored_per_channel 100;
# message ttl
push_stream_message_ttl 5m;
# ping frequency
push_stream_ping_message_interval 1s;
# connection ttl to enable recycle
push_stream_subscriber_connection_ttl 15m;
# connection ttl for long polling
push_stream_longpolling_connection_ttl 30s;
push_stream_timeout_with_body off;
# wildcard
push_stream_wildcard_channel_prefix "broad_";
push_stream_wildcard_channel_max_qtd 3;
push_stream_authorized_channels_only off;
push_stream_allowed_origins "*";
...
}
server {
...
chunked_transfer_encoding off;
location /pub {
push_stream_publisher admin;
allow 127.0.0.1;
push_stream_store_messages on;
push_stream_channels_path $arg_id;
client_max_body_size 32k;
client_body_buffer_size 32k;
}
location ~ /lp/(.*) {
push_stream_subscriber long-polling;
push_stream_channels_path $1;
push_stream_last_received_message_tag $arg_tag;
push_stream_last_received_message_time $arg_time;
push_stream_longpolling_connection_ttl 30s;
default_type "text/html; charset=utf-8";
push_stream_message_template "{\"id\":~id~,\"channel\":\"~channel~\",\"text\":\"~text~\",\"tag\":\"~tag~\",\"time\":\"~time~\"}";
}
...
}