Wireshark-commits: [Wireshark-commits] master 02a3056: androiddump: Fix non-blocking connect on Win
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sat, 10 Feb 2018 07:46:06 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=02a3056af383f4230873d7cd1a76654e1ab19969
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

02a3056 by Florian Bezold (florian.bezold@xxxxxxxxxxx):

    androiddump: Fix non-blocking connect on Windows
    
    Commit 043ed1f6 enabled non-blocking connect on Windows. This seems to
    break androiddump on Windows completely, since a successful connection
    always returns SOCKET_ERROR on connect, with WSAGetLastError() set to
    WSAEWOULDBLOCK.
    
    Apparently, the only way to check for a real connection is to try a
    write select on the socket:
    https://stackoverflow.com/questions/35370239/timeout-in-connect-function-from-winsock
    
    This fixes androiddump on Windows:
    - If ADB server is running, extcap interfaces are listed
    - If ADB is not running, there is no noticeable delay in Wireshark
    
    Change-Id: I6bd772215c7b232c8fe8e840cb7ad1d54c7d8860
    Reviewed-on: https://code.wireshark.org/review/25715
    Petri-Dish: Michael Mann <mmann78@xxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  bfef57e   androiddump: Fix and simplify tcpdump capture
    adds  02a3056   androiddump: Fix non-blocking connect on Windows


Summary of changes:
 extcap/androiddump.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)