18944b7 virnetclientstream: Process stream messages later

Authored and Committed by mprivozn 8 years ago
    virnetclientstream: Process stream messages later
    
    There are two functions on the client that handle incoming stream
    data.  The first one virNetClientStreamQueuePacket() is a low
    level function that just processes the incoming stream data from
    the socket and stores it into an internal structure. This happens
    in the client event loop therefore the shorter the callbacks are,
    the better. The second function virNetClientStreamRecvPacket()
    then handles copying data from internal structure into a client
    provided buffer.
    Change introduced in this commit makes just that: new queue for
    incoming stream packets is introduced. Then instead of copying
    data into intermediate internal buffer and then copying them into
    user buffer, incoming stream messages are queue into the queue
    and data is copied just once - in the upper layer function
    virNetClientStreamRecvPacket(). In the end, there's just one
    copying of data and therefore shorter event loop callback. This
    should boost the performance which has proven to be the case in
    my testing.
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    
        
file modified
+54 -52