mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-11 05:43:33 +00:00
1. Updated 'method' property of InboundMessage to be enumerable
2. Added memory check to ptrs structure 3. Fixed bug with remoteInterface's flags
This commit is contained in:
@@ -3025,7 +3025,7 @@ void ILibDuktape_HttpStream_AddHeaderDef(duk_context *ctx, struct packetheader *
|
|||||||
duk_get_prop_string(ctx, -1, "toUpperCase"); // [message][method][toUpper]
|
duk_get_prop_string(ctx, -1, "toUpperCase"); // [message][method][toUpper]
|
||||||
duk_swap_top(ctx, -2); // [message][toUpper][this]
|
duk_swap_top(ctx, -2); // [message][toUpper][this]
|
||||||
duk_call_method(ctx, 0); // [message][method]
|
duk_call_method(ctx, 0); // [message][method]
|
||||||
ILibDuktape_CreateReadonlyProperty(ctx, "method"); // [message]
|
ILibDuktape_CreateReadonlyProperty_SetEnumerable(ctx, "method", 1); // [message]
|
||||||
|
|
||||||
duk_push_lstring(ctx, header->DirectiveObj, header->DirectiveObjLength);// [message][url]
|
duk_push_lstring(ctx, header->DirectiveObj, header->DirectiveObjLength);// [message][url]
|
||||||
duk_put_prop_string(ctx, -2, "url"); // [message]
|
duk_put_prop_string(ctx, -2, "url"); // [message]
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ void ILibDuktape_WebRTC_DataChannel_OnData(struct ILibWrapper_WebRTC_DataChannel
|
|||||||
{
|
{
|
||||||
ILibDuktape_WebRTC_DataChannel *ptrs = (ILibDuktape_WebRTC_DataChannel*)dataChannel->userData;
|
ILibDuktape_WebRTC_DataChannel *ptrs = (ILibDuktape_WebRTC_DataChannel*)dataChannel->userData;
|
||||||
|
|
||||||
if (ptrs != NULL) { ILibDuktape_DuplexStream_WriteDataEx(ptrs->stream, dataType == 51 ? 1 : 0, data, dataLen); }
|
if (ptrs != NULL && ILibMemory_CanaryOK(ptrs)) { ILibDuktape_DuplexStream_WriteDataEx(ptrs->stream, dataType == 51 ? 1 : 0, data, dataLen); }
|
||||||
}
|
}
|
||||||
duk_ret_t ILibDuktape_WebRTC_DataChannel_Finalizer(duk_context *ctx)
|
duk_ret_t ILibDuktape_WebRTC_DataChannel_Finalizer(duk_context *ctx)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ struct ILibAsyncUDPSocket_Data
|
|||||||
void ILibAsyncUDPSocket_OnDataSink(ILibAsyncSocket_SocketModule socketModule, char* buffer, int *p_beginPointer, int endPointer, ILibAsyncSocket_OnInterrupt* OnInterrupt, void **user, int *PAUSE)
|
void ILibAsyncUDPSocket_OnDataSink(ILibAsyncSocket_SocketModule socketModule, char* buffer, int *p_beginPointer, int endPointer, ILibAsyncSocket_OnInterrupt* OnInterrupt, void **user, int *PAUSE)
|
||||||
{
|
{
|
||||||
struct ILibAsyncUDPSocket_Data *data = (struct ILibAsyncUDPSocket_Data*)*user;
|
struct ILibAsyncUDPSocket_Data *data = (struct ILibAsyncUDPSocket_Data*)*user;
|
||||||
char RemoteAddress[8 + sizeof(struct sockaddr_in6)];
|
char RemoteAddress[16 + sizeof(struct sockaddr_in6)] = { 0 };
|
||||||
UNREFERENCED_PARAMETER( OnInterrupt );
|
UNREFERENCED_PARAMETER( OnInterrupt );
|
||||||
UNREFERENCED_PARAMETER( RemoteAddress );
|
UNREFERENCED_PARAMETER( RemoteAddress );
|
||||||
ILibAsyncSocket_GetRemoteInterface(socketModule, (struct sockaddr*)&RemoteAddress);
|
ILibAsyncSocket_GetRemoteInterface(socketModule, (struct sockaddr*)&RemoteAddress);
|
||||||
|
|||||||
@@ -5625,7 +5625,7 @@ void ILibStun_CreateDtlsSession(struct ILibStun_Module *obj, int sessionId, int
|
|||||||
if (obj->dTlsSessions[sessionId] == NULL)
|
if (obj->dTlsSessions[sessionId] == NULL)
|
||||||
{
|
{
|
||||||
void *mem;
|
void *mem;
|
||||||
obj->dTlsSessions[sessionId] = ILibMemory_Allocate(sizeof(struct ILibStun_dTlsSession), 8 + sizeof(struct sockaddr_in6), NULL, &mem);
|
obj->dTlsSessions[sessionId] = ILibMemory_Allocate(sizeof(struct ILibStun_dTlsSession), 16 + sizeof(struct sockaddr_in6), NULL, &mem);
|
||||||
obj->dTlsSessions[sessionId]->remoteInterface = (struct sockaddr_in6*)mem;
|
obj->dTlsSessions[sessionId]->remoteInterface = (struct sockaddr_in6*)mem;
|
||||||
((int*)((char*)mem + sizeof(struct sockaddr_in6)))[0] = 4;
|
((int*)((char*)mem + sizeof(struct sockaddr_in6)))[0] = 4;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user