Wireshark-commits: [Wireshark-commits] master 2ee483a: Move the Winsock initialization and cleanup

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 02 May 2019 09:29:07 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=2ee483a222bc765f8a738dfa15124826d89dc543
Submitter: "Guy Harris <guy@xxxxxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

2ee483a by Guy Harris (guy@xxxxxxxxxxxx):

    Move the Winsock initialization and cleanup to wsutil routines.
    
    Those routines exist on both Windows and UN*X, but they don't do
    anything on UN*X (they could if it were ever necessary).
    
    That eliminates some #ifdefs, and also means that the gory details of
    initializing Winsock, including the Winsock version being requested,
    are buried in one routine.
    
    The initialization routine returns NULL on success and a pointer to a
    g_malloc()ated error message on failure; report the error to the user,
    along with a "report this to the Wireshark developers" suggestion.
    
    That means including wsutil/socket.h, which obviates the need to include
    some headers for socket APIs, as it includes them for you.
    
    Change-Id: I9327bbf25effbb441e4217edc5354a4d5ab07186
    Reviewed-on: https://code.wireshark.org/review/33045
    Petri-Dish: Guy Harris <guy@xxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    

Actions performed:

    from  7bc066a   mqtt: Dissect publish message as bytes
     add  2ee483a   Move the Winsock initialization and cleanup to wsutil routines.


Summary of changes:
 debian/libwsutil0.symbols |  2 ++
 dumpcap.c                 | 31 +++++++++++++-----------------
 extcap/CMakeLists.txt     |  2 ++
 extcap/androiddump.c      | 25 +++++++++++-------------
 extcap/ciscodump.c        | 25 +++++++++++-------------
 extcap/randpktdump.c      | 26 ++++++++++++-------------
 extcap/sshdump.c          | 25 +++++++++++-------------
 extcap/udpdump.c          | 33 ++++++++++++-------------------
 rawshark.c                | 29 +++++++++++++---------------
 sharkd_daemon.c           | 19 +++++++++---------
 tshark.c                  | 28 ++++++++++++---------------
 ui/qt/main.cpp            | 22 +++++++++------------
 wsutil/CMakeLists.txt     |  1 +
 wsutil/socket.c           | 49 +++++++++++++++++++++++++++++++++++++++++++++++
 wsutil/socket.h           | 22 +++++++++++++++++++++
 15 files changed, 189 insertions(+), 150 deletions(-)
 create mode 100644 wsutil/socket.c