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

examples/websocket.c: check for CURLE_AGAIN on recv_pong() #12980

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Feb 24, 2024

  1. examples/websocket.c: check for CURLE_AGAIN on recv_pong()

    The example file docs/examples/websocket.c does not work out of the
    box, because the recv_pong() function does not consider that the
    curl_ws_recv() function might return CURLE_AGAIN if there is no data
    to read, causing the program to terminate prematurely.
    
    This commit addresses this by using select(2) to make receiving pong
    blocking, and thus being able to continue with the main loop.
    
    This also occurs in the example file sendrecv.c, which also makes use
    of select(2) for sending and receiving data, which I based on for
    this commit.
    Theldus committed Feb 24, 2024
    Configuration menu
    Copy the full SHA
    244759d View commit details
    Browse the repository at this point in the history