From: Dave Cottlehuber Date: Fri, 1 Sep 2023 14:47:41 +0000 (+0000) Subject: ws: fix spelling mistakes in examples and tests X-Git-Tag: curl-8_3_0~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a86fcb284f7700dd6bfde653e2720665c93b8204;p=thirdparty%2Fcurl.git ws: fix spelling mistakes in examples and tests Closes #11784 --- diff --git a/docs/examples/websocket.c b/docs/examples/websocket.c index 52a09032cc..dbcd044f5a 100644 --- a/docs/examples/websocket.c +++ b/docs/examples/websocket.c @@ -39,7 +39,7 @@ static int ping(CURL *curl, const char *send_payload) return (int)result; } -static int recv_pong(CURL *curl, const char *exected_payload) +static int recv_pong(CURL *curl, const char *expected_payload) { size_t rlen; const struct curl_ws_frame *meta; @@ -49,8 +49,8 @@ static int recv_pong(CURL *curl, const char *exected_payload) if(meta->flags & CURLWS_PONG) { int same = 0; fprintf(stderr, "ws: got PONG back\n"); - if(rlen == strlen(exected_payload)) { - if(!memcmp(exected_payload, buffer, rlen)) { + if(rlen == strlen(expected_payload)) { + if(!memcmp(expected_payload, buffer, rlen)) { fprintf(stderr, "ws: got the same payload back\n"); same = 1; } diff --git a/tests/http/clients/ws-pingpong.c b/tests/http/clients/ws-pingpong.c index a81c09012f..dc36d45482 100644 --- a/tests/http/clients/ws-pingpong.c +++ b/tests/http/clients/ws-pingpong.c @@ -52,7 +52,7 @@ static CURLcode ping(CURL *curl, const char *send_payload) return result; } -static CURLcode recv_pong(CURL *curl, const char *exected_payload) +static CURLcode recv_pong(CURL *curl, const char *expected_payload) { size_t rlen; const struct curl_ws_frame *meta; @@ -71,8 +71,8 @@ static CURLcode recv_pong(CURL *curl, const char *exected_payload) } fprintf(stderr, "ws: got PONG back\n"); - if(rlen == strlen(exected_payload) && - !memcmp(exected_payload, buffer, rlen)) { + if(rlen == strlen(expected_payload) && + !memcmp(expected_payload, buffer, rlen)) { fprintf(stderr, "ws: got the same payload back\n"); return CURLE_OK; } diff --git a/tests/libtest/lib2301.c b/tests/libtest/lib2301.c index 17afb5f536..e654f8166b 100644 --- a/tests/libtest/lib2301.c +++ b/tests/libtest/lib2301.c @@ -38,7 +38,7 @@ static int ping(CURL *curl, const char *send_payload) return (int)result; } -static int recv_pong(CURL *curl, const char *exected_payload) +static int recv_pong(CURL *curl, const char *expected_payload) { size_t rlen; unsigned int rflags; @@ -48,8 +48,8 @@ static int recv_pong(CURL *curl, const char *exected_payload) if(rflags & CURLWS_PONG) { int same = 0; fprintf(stderr, "ws: got PONG back\n"); - if(rlen == strlen(exected_payload)) { - if(!memcmp(exected_payload, buffer, rlen)) { + if(rlen == strlen(expected_payload)) { + if(!memcmp(expected_payload, buffer, rlen)) { fprintf(stderr, "ws: got the same payload back\n"); same = 1; } diff --git a/tests/libtest/lib2302.c b/tests/libtest/lib2302.c index 063c26d051..b581659a4b 100644 --- a/tests/libtest/lib2302.c +++ b/tests/libtest/lib2302.c @@ -39,7 +39,7 @@ static int ping(CURL *curl, const char *send_payload) return (int)result; } -static int recv_pong(CURL *curl, const char *exected_payload) +static int recv_pong(CURL *curl, const char *expected_payload) { size_t rlen; unsigned int rflags; @@ -49,8 +49,8 @@ static int recv_pong(CURL *curl, const char *exected_payload) if(rflags & CURLWS_PONG) { int same = 0; fprintf(stderr, "ws: got PONG back\n"); - if(rlen == strlen(exected_payload)) { - if(!memcmp(exected_payload, buffer, rlen)) { + if(rlen == strlen(expected_payload)) { + if(!memcmp(expected_payload, buffer, rlen)) { fprintf(stderr, "ws: got the same payload back\n"); same = 1; } diff --git a/tests/libtest/lib2304.c b/tests/libtest/lib2304.c index aff92bfa75..a8ee87548a 100644 --- a/tests/libtest/lib2304.c +++ b/tests/libtest/lib2304.c @@ -38,7 +38,7 @@ static int ping(CURL *curl, const char *send_payload) return (int)result; } -static int recv_pong(CURL *curl, const char *exected_payload) +static int recv_pong(CURL *curl, const char *expected_payload) { size_t rlen; const struct curl_ws_frame *meta; @@ -48,8 +48,8 @@ static int recv_pong(CURL *curl, const char *exected_payload) if(meta->flags & CURLWS_PONG) { int same = 0; fprintf(stderr, "ws: got PONG back\n"); - if(rlen == strlen(exected_payload)) { - if(!memcmp(exected_payload, buffer, rlen)) { + if(rlen == strlen(expected_payload)) { + if(!memcmp(expected_payload, buffer, rlen)) { fprintf(stderr, "ws: got the same payload back\n"); same = 1; }