Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mingw-w64 + improve ddsrt_recvmsg interface #2053

Merged

Commits on Jul 1, 2024

  1. Delete broken alternative for thread sanitizer

    Signed-off-by: Erik Boasson <[email protected]>
    eboasson committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    4751e36 View commit details
    Browse the repository at this point in the history
  2. Improve ddsrt_recvmsg interface

    There is only one caller of ddsrt_recvmsg (outside the tests), ddsi_udp_conn_read, and it
    assumed that ddsrt_recvmsg:
    
    1. returns OK with *rcvd > 0
    2. returns OK with *rcvd = 0
    3. returns not-OK with *rcvd untouched or set to 0
    
    Case 1 is the perfectly ordinary case.
    
    Case 2 is treated as a spurious but successful read.  This is somewhat weird: the socket
    triggers because data is available and so a read should return something.  IIRC it is
    there because with OpenSSL 3 and TCP+TLS I saw received bytes all getting consumed
    internally by OpenSSL during a handshake.  Anyway, it exists.
    
    Case 3 is for all errors.  The "*rcvd untouched or set to 0" was important because
    ddsi_udp_conn_read would first check whether it is > 0.  It initializes it to 0, so if it
    is untouched on error or set to 0, all is well.
    
    The one caller of ddsi_udp_conn_read is ddsi_receive.c:do_packet, which simply ignores any
    call to ddsi_udp_conn_read that returns <= 0.  So case 2 can be propagated by returning
    0 (successful spurious read) or < 0 (error) without any difference in behaviour.
    
    This requirement on *rcvd in case of an error is an accident waiting to happen.  This
    commit changes the interface so that it is:
    
    1. OK and *rcvd >= 0
    2. not-OK and *rcvd undefined
    
    This requires no changes on the implementation of ddsrt_recvmsg.  The change in the
    caller is trivial and makes it as one would expect.
    
    Signed-off-by: Erik Boasson <[email protected]>
    eboasson committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    8e82fd3 View commit details
    Browse the repository at this point in the history
  3. Turn off PACKET_DESTINATION_INFO for mingw-w64.

    The CMSG_* macros used in CycloneDDS are not provided by mingw-w64-gcc (only WSA*).
    
    Signed-off-by: Erik Boasson <[email protected]>
    eboasson committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    c61d6d2 View commit details
    Browse the repository at this point in the history