-
Notifications
You must be signed in to change notification settings - Fork 343
Refactor Signaling sources to make Include_i.h
independent of libwebsockets
#2141
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,11 +167,14 @@ extern "C" { | |
// Encoded max ice server infos string len | ||
#define MAX_ENCODED_ICE_SERVER_INFOS_STR_LEN (MAX_ICE_SERVER_INFOS_STR_LEN + ICE_SERVER_INFO_TEMPLATE_BLOAT_SIZE) | ||
|
||
// Alignment bytes for libwebsockets (Internally, it might end up using lesser than 16) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LWS_PRE is libwebsockets defined macro! We just use 16 bytes extra than required by message. libwebsockets can freely use these extra 16 bytes for its alignment needs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like it would eventually make sense to have an "ApiCalls" interface to abstract away lws (similar to how Tls.h is setup). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My first thoughts were to have a function pointers structure and have it initialised with the required ApiCalls by the implementation. (The default would be the libwebsockets). |
||
#define LWS_ALIGN_BYTES 16 | ||
|
||
// Scratch buffer size | ||
#define LWS_SCRATCH_BUFFER_SIZE (MAX_JSON_PARAMETER_STRING_LEN + LWS_PRE) | ||
#define LWS_SCRATCH_BUFFER_SIZE (MAX_JSON_PARAMETER_STRING_LEN + LWS_ALIGN_BYTES) | ||
|
||
// Send and receive buffer size | ||
#define LWS_MESSAGE_BUFFER_SIZE (SIZEOF(CHAR) * (MAX_SIGNALING_MESSAGE_LEN + LWS_PRE)) | ||
#define LWS_MESSAGE_BUFFER_SIZE (SIZEOF(CHAR) * (MAX_SIGNALING_MESSAGE_LEN + LWS_ALIGN_BYTES)) | ||
|
||
#define AWS_SIG_V4_HEADER_HOST (PCHAR) "host" | ||
|
||
|
@@ -251,8 +254,8 @@ PVOID lwsListenerHandler(PVOID); | |
PVOID reconnectHandler(PVOID); | ||
|
||
// LWS callback routine | ||
INT32 lwsHttpCallbackRoutine(struct lws*, enum lws_callback_reasons, PVOID, PVOID, size_t); | ||
INT32 lwsWssCallbackRoutine(struct lws*, enum lws_callback_reasons, PVOID, PVOID, size_t); | ||
INT32 lwsHttpCallbackRoutine(PVOID, INT32, PVOID, PVOID, size_t); | ||
INT32 lwsWssCallbackRoutine(PVOID, INT32, PVOID, PVOID, size_t); | ||
|
||
BOOL isCallResultSignatureExpired(PCallInfo); | ||
BOOL isCallResultSignatureNotYetCurrent(PCallInfo); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this was earlier satisfied from
libwebsockets.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this platform independent, I think we should pass it as a compiler flag and only include if true.
cmake:
C:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe similar for
ifaddrs.h