Skip to content

Connection to WS server fails #3367

@PoltoS

Description

@PoltoS

Hello!

After upgrading we found that connection to WS server fails on Android platform. We identified the commit introducing the issue: ef4a85d (previous commit works fine)

From the code it looks like in some cases one CRLF is missing compared to previous commit. Probably LWS_CPYAPP(p, "\x0d\x0a"); should be moved just outside of }:

LWS_CPYAPP(p, "\x0d\x0aSec-WebSocket-Protocol: ");
p += lws_snprintf(p, 128, "%s", prot);
LWS_CPYAPP(p, "\x0d\x0a");
}

I don't think it has something to do with Android, but with specific compilation flags we use to compile (I think it is about LWS_WITHOUT_EXTENSIONS):

CFLAGS="-I${ANDROID_TOOLCHAIN}/include -I${ANDROID_TOOLCHAIN}/sysroot/usr/include -I${TARGET_DIR}/include" cmake \
            -DANDROID_TOOLCHAIN_NAME=${ANDROID_TOOLCHAIN_ABI}-${ANDROID_API} \
            -DANDROID_PLATFORM=android-${ANDROID_API} \
            -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
            -DLWS_WITH_SHARED=ON \
            -DLWS_WITH_STATIC=ON \
            -DLWS_WITHOUT_TESTAPPS=ON \
            -DLWS_WITH_ZLIB=ON \
            -DLWS_STATIC_PIC=ON \
            -DLWS_AVOID_SIGPIPE_IGN=ON \
            -DLWS_OPENSSL_INCLUDE_DIRS=${TARGET_DIR}/include \
            -DLWS_OPENSSL_LIBRARIES="${TARGET_DIR}/lib/libssl.a;${TARGET_DIR}/lib/libcrypto.a" \
            -DCMAKE_INSTALL_PREFIX=${TARGET_DIR} \
            .. 

Andy @lws-team, could you please have a look at it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions