Skip to content
  • Eric Blake's avatar
    10b89988
    nbd/client: Split handshake into two functions · 10b89988
    Eric Blake authored
    
    
    An upcoming patch will add the ability for qemu-nbd to list
    the services provided by an NBD server.  Share the common
    code of the TLS handshake by splitting the initial exchange
    into a separate function, leaving only the export handling
    in the original function.  Functionally, there should be no
    change in behavior in this patch, although some of the code
    motion may be difficult to follow due to indentation changes
    (view with 'git diff -w' for a smaller changeset).
    
    I considered an enum for the return code coordinating state
    between the two functions, but in the end just settled with
    ample comments.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarRichard W.M. Jones <rjones@redhat.com>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20190117193658.16413-15-eblake@redhat.com>
    10b89988
    nbd/client: Split handshake into two functions
    Eric Blake authored
    
    
    An upcoming patch will add the ability for qemu-nbd to list
    the services provided by an NBD server.  Share the common
    code of the TLS handshake by splitting the initial exchange
    into a separate function, leaving only the export handling
    in the original function.  Functionally, there should be no
    change in behavior in this patch, although some of the code
    motion may be difficult to follow due to indentation changes
    (view with 'git diff -w' for a smaller changeset).
    
    I considered an enum for the return code coordinating state
    between the two functions, but in the end just settled with
    ample comments.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarRichard W.M. Jones <rjones@redhat.com>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-Id: <20190117193658.16413-15-eblake@redhat.com>
Loading