Commit Graph

15 Commits

Author SHA1 Message Date
Christophe Fergeau
28fa3b1b3f Introduce reds_stream_set_channel() 2014-01-20 12:15:42 +01:00
Christophe Fergeau
82511418a0 Introduce reds_stream_set_info_flag() 2014-01-20 12:15:42 +01:00
Christophe Fergeau
25aca54f12 Make RedsStream::async_read private 2014-01-20 12:15:42 +01:00
Christophe Fergeau
dc04c076ef Make RedsStream::sasl private 2014-01-20 12:15:42 +01:00
Christophe Fergeau
284f9d0d7a Make RedsStream read/write functions private 2014-01-20 12:15:42 +01:00
Christophe Fergeau
520ebdc815 Make RedsStream::ssl private 2014-01-20 12:15:42 +01:00
Christophe Fergeau
30fecf87f8 Introduce reds_stream_is_ssl() 2014-01-20 12:15:42 +01:00
Christophe Fergeau
1f7123298f Add RedsStream::priv
The private data is allocated at the same time as RedsStream and
goes immediatly after the main RedsStream data.
This private member will allow to hide internal RedsStream
implementation details from the rest of spice-server.
2014-01-20 12:15:42 +01:00
Christophe Fergeau
7ff743c431 Move SASL authentication to reds_stream.h
SASL authentication mostly use members from RedsStream to do its work, so
it makes sense to have its code in reds_stream.c. This should allow to make
RedsStream::sasl private in the future.
2014-01-20 12:15:42 +01:00
Christophe Fergeau
9feed6940f Move async code to RedsStream
The AsyncRead structure in reds.h wraps an async read + callback to
be done on a stream. Moving it to reds_stream.h is needed in order
to move SASL authentication there.
2014-01-20 12:15:42 +01:00
Christophe Fergeau
cdaab7272c Move stream read/write callbacks to reds_stream.c
Now that stream creation and SSL enabling are done by helpers
in reds_stream.c, we can move the initialization of the vfunc
read/write pointers there too.
2014-01-20 12:15:41 +01:00
Christophe Fergeau
e0abf1adc2 Introduce reds_stream_new() helper
Initializing a new stream means initializing quite a few fields.
This commit factors this initialization in a dedicated reds_stream_new
helper. This also helps moving more code from reds.c to reds_stream.c
2014-01-20 12:15:41 +01:00
Christophe Fergeau
d533f72fe6 reds: Move SSL-related code to RedsStream
Code to initiate a SSL stream belongs there
2014-01-20 12:15:41 +01:00
Christophe Fergeau
e46743100f Move sync_write* to reds_stream.h
They are renamed to reds_stream_write*
2014-01-20 12:15:41 +01:00
Christophe Fergeau
8b347a641c Add reds_stream.[ch]
Gather common RedsStream code there rather than having it
in reds.c
2014-01-20 12:15:41 +01:00