cockpit-project/cockpit — pull request #123 by magcius (2013-11-14 05:14:53+00:00)
Title: websocketconnection: Fix web_socket_client_new

web_socket_client_new, as used in frob-weboscket, does not take an
IO stream on construction. Instead, it connects to an arbitrary URI
using g_socket_client_connect_to_uri, and then tries to set up the
WebSocketConnection using the private _web_socket_connect_take_io_stream
API. The issue is that WebSocketConnection tries to read from the IO
stream in an idle set after construction, but we can't be guaranteed
that the IO stream will exist at this time.

Create the idle in _web_socket_connection_take_io_stream, which should
always be called when we set the IO stream for a WebSocketConnection.