Skip to content
  • Marc-André Lureau's avatar
    sbuf: simplify sbreserve() · be26d1cc
    Marc-André Lureau authored
    
    
    realloc/g_realloc() allocates memory if given ptr is NULL.
    
    Note:
    This changes a bit the code, since now sb_cc is always reset to 0,
    even if old and new value are the same. This seems more coherent, but
    may have weird side-effects if code relies on it.
    
    Reviewing usage of sbreserve() reveals that it is used before the
    socket buffer receives any data, at tcp_input() socket creation time,
    and during tcp_mss() which is earlier in TCP socket state.
    
    Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    be26d1cc