nicolasff / webdis

A Redis HTTP interface with JSON output
https://webd.is
BSD 2-Clause "Simplified" License
2.83k stars 304 forks source link

SUBSCRIBE closes connection, does not keep-alive? #32

Closed okko closed 12 years ago

okko commented 12 years ago

I'm unable to subscribe to a channel through HTTP. It appears the connection gets closed as soon as the subscription is done, and that HTTP headers (ie. content-type) are completely missing from the response. Should it work?

$ tests/pubsub -r 10 -w 10 -n 10
# kept it running, can see in the Redis log the SUBSCRIBE commands and the PUBLISH commands
Received 0 messages from 10 writers to 10 readers through 1 channels in 273.75 sec: received 0.00 msg/sec
$ telnet localhost 7379
GET /SUBSCRIBE/chan HTTP/1.1

24
{"SUBSCRIBE":["subscribe","chan",1]}
Connection closed by foreign host.
nicolasff commented 12 years ago

Fixed! This was a regression and is indeed not supposed to happen.

okko commented 12 years ago

Now the connection stays properly open and data is transferred, thanks, but the HTTP headers are still missing. For example,

Content-Type: application/json
Date: Mon, 03 Jan 2011 20:43:36 GMT
Transfer-Encoding: chunked
(and the empty line)
nicolasff commented 12 years ago

You are right, sorry about that; most of the issues with pub/sub are regressions from a previous change and it seems that there were still problems with pub/sub.

Please try the latest master, I have just pushed a fix and confirmed that headers are sent properly.

okko commented 12 years ago

Thank you again, now it works beautifully.