[Spice-devel] [PATCH 2/6] Rename __reds_accept_connection into reds_init_client_connection

Daniel P. Berrange berrange at redhat.com
Fri Oct 28 03:11:29 PDT 2011


On Wed, Oct 26, 2011 at 03:29:55PM +0200, Marc-André Lureau wrote:
> Hi
> 
> I would move the cb intialization in reds_init_client_connection () to
> avoid duplication:
> 
>     stream = link->stream;
>     stream->read = stream_read_cb;
>     stream->write = stream_write_cb;
>     stream->writev = stream_writev_cb;
> 
> It will be overwritten in reds_init_client_ssl_connection ().

Hmm, since the SSL methods don't want these settings anyway, the only real
duplication for these lines of code is between reds_accept() and the new
reds_add_client() method. If I change reds_accept() to actually call the
new reds_add_client() method too, then we won't have any duplication. So
I don't think we need to move these into reds_init_client_connection()
after all.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


More information about the Spice-devel mailing list