John Anderson have merged my changes and a bunch of other pull requests, many thanks!
I am in the process of fixing all the transports and consequently, I have other fixes to push. I have already fixed a problem in the json-polling transport that was not escaping the data properly and I'm currently polishing my htmlfile fixes. I have nearly all transports working except xhr-multipart that I cannot test. You will receive another pull request very soon.
However, I have some questions :
- Are the jstests executed by travis-ci? It would be nice!
- I can't test the xhr-multipart: it seems that its support has been removed from socket.io.js. How can I test this transport? (it seems broken too, just by looking at the code)
- I am not sure if I fixed the htmlfile transport properly. I dug into the WSGI handler since this transport needs to keep the (GET) socket open, as in the websocket transports, but behaves like the polling transports otherwise (i.e. unidirectional with get and post). However, I don't fully understand what's going on in the WSGI handler. At first, I was thinking that a WSGI middleware would suffice, except maybe for the flash policy server : you would intercept the
socket.io requests and pass the other requests to the application unchanged. Why a WSGIHandler is used instead of a simple WSGI middleware? Because we need to access the server socket? Also, why do we need to pass the control to the application in the case of a
socket.io request (where the application just call socketio_manage in the examples I have seen)? So that the users can spawn whatever background jobs they want to feed the socket? Why the application is run via a spawn? Also, why don't we use the WSGIHandler's result and process_result() facilities for writing the response? I think the recent problems with gevent 1.0 are just due to that fact (chunked responses were triggered inadvertently).
FYI, I found a documentation that is really helpful to understand the
socket.io transports:
http://showmetheco.de/articles/2011/8/socket-io-for-backend-developers.htmlThanks in advance for you help!