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

don't use keepalive flags if they are not defined #212

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/tlsuv.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,16 @@
if (uv_fileno((const uv_handle_t *) &clt->watcher, (uv_os_fd_t *) &s) == 0) {
int count = 10;
int intvl = 1;
setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &keepalive, sizeof(keepalive));

Check warning on line 168 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, openssl)

'function': incompatible types - from 'int *' to 'const char *'

Check warning on line 168 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, mbedtls)

'function': incompatible types - from 'int *' to 'const char *'
#if defined(TCP_KEEPALIVE)
setsockopt(s, IPPROTO_TCP, TCP_KEEPALIVE, &delay, sizeof(delay));

Check warning on line 170 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, openssl)

'function': incompatible types - from 'unsigned int *' to 'const char *'

Check warning on line 170 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, mbedtls)

'function': incompatible types - from 'unsigned int *' to 'const char *'
#endif
#if defined(TCP_KEEPINTVL)
setsockopt(s, IPPROTO_TCP, TCP_KEEPINTVL, &intvl, sizeof(intvl));

Check warning on line 173 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, openssl)

'function': incompatible types - from 'int *' to 'const char *'

Check warning on line 173 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, mbedtls)

'function': incompatible types - from 'int *' to 'const char *'
#endif
#if defined(TCP_KEEPCNT)
setsockopt(s, IPPROTO_TCP, TCP_KEEPCNT, &count, sizeof(count));

Check warning on line 176 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, openssl)

'function': incompatible types - from 'int *' to 'const char *'

Check warning on line 176 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, mbedtls)

'function': incompatible types - from 'int *' to 'const char *'
#endif
}
return 0;
}
Expand All @@ -178,7 +182,7 @@
int tlsuv_stream_nodelay(tlsuv_stream_t *clt, int nodelay) {
uv_os_fd_t s;
if (uv_fileno((const uv_handle_t *) &clt->watcher, &s) == 0) {
setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &nodelay, sizeof(nodelay));

Check warning on line 185 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, openssl)

'function': 'SOCKET' differs in levels of indirection from 'uv_os_fd_t'

Check warning on line 185 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, openssl)

'setsockopt': different types for formal and actual parameter 1

Check warning on line 185 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, openssl)

'function': incompatible types - from 'int *' to 'const char *'

Check warning on line 185 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, mbedtls)

'function': 'SOCKET' differs in levels of indirection from 'uv_os_fd_t'

Check warning on line 185 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, mbedtls)

'setsockopt': different types for formal and actual parameter 1

Check warning on line 185 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, mbedtls)

'function': incompatible types - from 'int *' to 'const char *'
}
return 0;
}
Expand Down Expand Up @@ -207,7 +211,7 @@
uv_connect_t *req = clt->conn_req;
int err = 0;
socklen_t l = sizeof(err);
getsockopt(clt->sock, SOL_SOCKET, SO_ERROR, &err, &l);

Check warning on line 214 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, openssl)

'function': incompatible types - from 'int *' to 'char *'

Check warning on line 214 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, mbedtls)

'function': incompatible types - from 'int *' to 'char *'

if (status == 0 && err != 0) {
#if _WIN32
Expand Down Expand Up @@ -307,7 +311,7 @@
ret = write_req(clt, &req->buf);
if (ret > 0) {
req->buf.base += ret;
req->buf.len -= ret;

Check warning on line 314 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, openssl)

'-=': conversion from 'ssize_t' to 'ULONG', possible loss of data

Check warning on line 314 in src/tlsuv.c

View workflow job for this annotation

GitHub Actions / build (windows, mbedtls)

'-=': conversion from 'ssize_t' to 'ULONG', possible loss of data

// complete
if (req->buf.len == 0) {
Expand Down
Loading