mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Merge !1204 -- tests: fix macOS CI runs
* upstream/pr/1204: test: http_unix_socket_test: fix url could be freed uninitialized test: regress_http: skip unix socket parsing tests in windows test: fix regress_http evhttp_bind_unixsocket() on macOS ci: fix macOS mbedtls version/search
This commit is contained in:
commit
74af13d5eb
7
.github/workflows/macos.yml
vendored
7
.github/workflows/macos.yml
vendored
@ -48,7 +48,7 @@ jobs:
|
|||||||
key: macos-10.15-cmake-${{ matrix.EVENT_MATRIX }}-v3
|
key: macos-10.15-cmake-${{ matrix.EVENT_MATRIX }}-v3
|
||||||
|
|
||||||
- name: Install Depends
|
- name: Install Depends
|
||||||
run: brew install mbedtls
|
run: brew install mbedtls@2
|
||||||
|
|
||||||
- name: Build And Test
|
- name: Build And Test
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -86,6 +86,7 @@ jobs:
|
|||||||
else
|
else
|
||||||
EVENT_CMAKE_OPTIONS=""
|
EVENT_CMAKE_OPTIONS=""
|
||||||
fi
|
fi
|
||||||
|
EVENT_CMAKE_OPTIONS="$EVENT_CMAKE_OPTIONS -DMBEDTLS_ROOT_DIR=/usr/local/opt/mbedtls@2"
|
||||||
|
|
||||||
#run build and test
|
#run build and test
|
||||||
JOBS=1
|
JOBS=1
|
||||||
@ -137,7 +138,7 @@ jobs:
|
|||||||
key: ${{ matrix.os }}-autotools-${{ matrix.EVENT_MATRIX }}-v3
|
key: ${{ matrix.os }}-autotools-${{ matrix.EVENT_MATRIX }}-v3
|
||||||
|
|
||||||
- name: Install Depends
|
- name: Install Depends
|
||||||
run: brew install autoconf automake libtool pkg-config mbedtls
|
run: brew install autoconf automake libtool pkg-config mbedtls@2
|
||||||
|
|
||||||
- name: Build And Test
|
- name: Build And Test
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -150,6 +151,8 @@ jobs:
|
|||||||
else
|
else
|
||||||
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH"
|
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||||
fi
|
fi
|
||||||
|
export CPPFLAGS="-I/usr/local/opt/mbedtls@2/include"
|
||||||
|
export LDFLAGS="-L/usr/local/opt/mbedtls@2/lib"
|
||||||
|
|
||||||
if [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_OPENSSL" ]; then
|
if [ "${{ matrix.EVENT_MATRIX }}" == "DISABLE_OPENSSL" ]; then
|
||||||
EVENT_CONFIGURE_OPTIONS="--disable-openssl"
|
EVENT_CONFIGURE_OPTIONS="--disable-openssl"
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -97,6 +97,8 @@ http-server
|
|||||||
http-connect
|
http-connect
|
||||||
le-proxy
|
le-proxy
|
||||||
https-client
|
https-client
|
||||||
|
https-client-mbedtls
|
||||||
|
ssl-client-mbedtls
|
||||||
signal-test
|
signal-test
|
||||||
time-test
|
time-test
|
||||||
event-test
|
event-test
|
||||||
|
@ -2238,7 +2238,8 @@ static int evhttp_bind_unixsocket(struct evhttp *httpd, const char *path)
|
|||||||
if (stat(path, &st) == 0 && S_ISSOCK(st.st_mode))
|
if (stat(path, &st) == 0 && S_ISSOCK(st.st_mode))
|
||||||
unlink(path);
|
unlink(path);
|
||||||
|
|
||||||
fd = socket(AF_UNIX, SOCK_CLOEXEC | SOCK_NONBLOCK | SOCK_STREAM, 0);
|
fd = evutil_socket_(AF_UNIX,
|
||||||
|
EVUTIL_SOCK_CLOEXEC | EVUTIL_SOCK_NONBLOCK | SOCK_STREAM, 0);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -2269,7 +2270,7 @@ static int evhttp_bind_unixsocket(struct evhttp *httpd, const char *path)
|
|||||||
static void http_unix_socket_test(void *arg)
|
static void http_unix_socket_test(void *arg)
|
||||||
{
|
{
|
||||||
struct basic_test_data *data = arg;
|
struct basic_test_data *data = arg;
|
||||||
struct evhttp_uri *uri;
|
struct evhttp_uri *uri = NULL;
|
||||||
struct evhttp_connection *evcon = NULL;
|
struct evhttp_connection *evcon = NULL;
|
||||||
struct evhttp_request *req;
|
struct evhttp_request *req;
|
||||||
|
|
||||||
@ -3036,9 +3037,11 @@ http_parse_uri_test(void *arg)
|
|||||||
BAD("http://www.example.com:hihi/");
|
BAD("http://www.example.com:hihi/");
|
||||||
BAD("://www.example.com/");
|
BAD("://www.example.com/");
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
UNI("http://unix:/tmp/foobar/:/foo");
|
UNI("http://unix:/tmp/foobar/:/foo");
|
||||||
UNI("http://user:pass@unix:/tmp/foobar/:/foo");
|
UNI("http://user:pass@unix:/tmp/foobar/:/foo");
|
||||||
UNI("http://unix:a:");
|
UNI("http://unix:a:");
|
||||||
|
#endif
|
||||||
|
|
||||||
/* bad URIs: joining */
|
/* bad URIs: joining */
|
||||||
uri = evhttp_uri_new();
|
uri = evhttp_uri_new();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user