Closed
Conversation
Compiling on _WIN32 and with USE_LWIPSOCK, causes this error:
curl_rtmp.c(223,3): error: use of undeclared identifier 'setsockopt'
setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_RCVTIMEO,
^
curl_rtmp.c(41,32): note: expanded from macro 'setsockopt'
#define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e)
^
(from with clang-cl).
Since 'setsockopt()' is really 'lwip_setsockopt()' in '<LWIP_ROOT>/src/include/lwip\sockets.h', do not redefine it.
Member
|
lwIP will take an int for rcvtime if it was built with LWIP_SO_SNDRCVTIMEO_NONSTANDARD. It doesn't say in the doc what causes that to be set. For example, is it set by default on Windows? (The only place where it would make any sense IMO). I searched the source but I don't see that it is actually turned on anywhere for any reason. Even if it was I don't know how we would determine that unless it was placed in a conf file? Just to be safe I propose we do this instead: diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c
index 9743064..d962127 100644
--- a/lib/curl_rtmp.c
+++ b/lib/curl_rtmp.c
@@ -37,8 +37,12 @@
/* The last #include file should be: */
#include "memdebug.h"
-#ifdef _WIN32
+#ifdef WIN32
#define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e)
+#endif
+
+#if (defined(WIN32) && !defined(USE_LWIPSOCK)) || \
+ defined(LWIP_SO_SNDRCVTIMEO_NONSTANDARD)
#define SET_RCVTIMEO(tv,s) int tv = s*1000
#else
#define SET_RCVTIMEO(tv,s) struct timeval tv = {s,0} |
Member
|
hm I see what you mean.. ok how about this: diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c
index 9743064..109f2b1 100644
--- a/lib/curl_rtmp.c
+++ b/lib/curl_rtmp.c
@@ -37,9 +37,11 @@
/* The last #include file should be: */
#include "memdebug.h"
-#ifdef _WIN32
+#if (defined(WIN32) && !defined(USE_LWIPSOCK))
#define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e)
#define SET_RCVTIMEO(tv,s) int tv = s*1000
+#elif defined(LWIP_SO_SNDRCVTIMEO_NONSTANDARD)
+#define SET_RCVTIMEO(tv,s) int tv = s*1000
#else
#define SET_RCVTIMEO(tv,s) struct timeval tv = {s,0}
#endif |
Contributor
Author
|
|
Per Jay Satiros comment, adapt for the case when 'LWIP_SO_SNDRCVTIMEO_NONSTANDARD = 1'
bagder
approved these changes
Oct 24, 2018
Member
|
I took the liberty of merging this. Thanks @gvanem ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Compiling on Windows (
_WIN32) withUSE_LWIPSOCK, causes this error:(from with clang-cl).
Since
setsockopt()is reallylwip_setsockopt()in<LWIP_ROOT>/src/include/lwip\sockets.h, do not redefine it.