Closed gigiu closed 10 years ago
hi, this is the expected behavior. When a timeout happens you only receive a 304 header response. The header and footer templates are sent only when a message is sent. Your client has to be prepared to this behavior. You can use the pushstream.js, it handle this for you.
Regards
mmm, so i guess you should fix your docs
push_stream_footer_template
syntax: push_stream_footer_template string
default: none
context: location (push_stream_subscriber)
release version: 0.2.6
The text that will be sended to subscribers before connection is closed (channel deleted ou subscriber timeout).
anyway i cant use pushstream.js, i need this for the api part of the site, and i need a custom message when timeout happen, there is any chance to get a simple patch for this?
thanks in advance
hi, any news on this? any change to have some sort of push_stream_timeout_message_text?
thanks again
hi. Sorry for the late response. I was checking the code and documentation and, in fact the documentation is incomplete. The header/footer template is sent on stream connections in which a timeout happens. When I added the long polling support, on versions 0.3.0/0.3.1, I forgot to update the docs, because a timeout on long polling never sent those templates. You can achieve what you want using the status code, if is a 200 the subscriber received a message, if is a 304 a timeout happened, and you can use your custom behaviour.
I will review the docs for the next version.
regards, Wandenberg
Hi! I've a similar problem: considering a jsonp request you can't read the response header (and, then, neither the status code), so it is not possible to know if a void response is a real void response or the server k.o. (for instance). Therefore I think that it will be great to have the ability (simply a trua/false flag) to send header/footer in any case (so a "void" response will have readable header and footer, while a k.o. server will be simply "void")
Thanks for your work ^_^
This was solved on tag 0.4.0 3d3a204177d3a7ab8a2858e04e792a6d11bf133f Now you can set to receive a complete response when a timeout happens.
hi, first of all thanks for your amazing work
i have a problem, pushstream[header,footer]_template is not sent when push_stream_longpolling_connection_ttl occur.
i use last version of nginx-push-stream-module
my simple config:
thanks in advance for your help :)