1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-02-12 14:33:20 +00:00

1. Updated libfinder for Linux for cases when ldconfig is not on PATH

2. Updated websockets, so it will autofragment into 30k chunks, as a temp workaround for platforms like CentOS 5.11 until I find the underlying issue
This commit is contained in:
Bryan Roe
2019-08-21 11:46:38 -07:00
parent dda535a817
commit 1360835f1b
3 changed files with 31 additions and 7 deletions

View File

@@ -3973,7 +3973,22 @@ int ILibDuktape_httpStream_webSocket_EncodedUnshiftSink(ILibDuktape_DuplexStream
ILibTransport_DoneState ILibDuktape_httpStream_webSocket_DecodedWriteSink(ILibDuktape_DuplexStream *stream, char *buffer, int bufferLen, void *user)
{
ILibDuktape_WebSocket_State *state = (ILibDuktape_WebSocket_State*)user;
return(ILibDuktape_httpStream_webSocket_WriteWebSocketPacket(state, stream->writableStream->Reserved == 1 ? ILibWebClient_WebSocket_DataType_TEXT : ILibWebClient_WebSocket_DataType_BINARY, buffer, bufferLen, ILibWebClient_WebSocket_FragmentFlag_Complete));
int maxsize = 30000;
int sendSize = 0;
if (bufferLen < maxsize)
{
return(ILibDuktape_httpStream_webSocket_WriteWebSocketPacket(state, stream->writableStream->Reserved == 1 ? ILibWebClient_WebSocket_DataType_TEXT : ILibWebClient_WebSocket_DataType_BINARY, buffer, bufferLen, ILibWebClient_WebSocket_FragmentFlag_Complete));
}
else
{
while(bufferLen > 0)
{
sendSize = bufferLen > maxsize ? maxsize : bufferLen;
bufferLen -= sendSize;
ILibDuktape_httpStream_webSocket_WriteWebSocketPacket(state, stream->writableStream->Reserved == 1 ? ILibWebClient_WebSocket_DataType_TEXT : ILibWebClient_WebSocket_DataType_BINARY, buffer, sendSize, bufferLen>0?ILibWebClient_WebSocket_FragmentFlag_Incomplete : ILibWebClient_WebSocket_FragmentFlag_Complete);
buffer += sendSize;
}
}
}
void ILibDuktape_httpStream_webSocket_DecodedEndSink(ILibDuktape_DuplexStream *stream, void *user)
{

File diff suppressed because one or more lines are too long

View File

@@ -23,6 +23,7 @@ var _NET_WM_STATE_TOGGLE = 2; // toggle property
var SubstructureRedirectMask = (1 << 20);
var SubstructureNotifyMask = (1 << 19);
function getLibInfo(libname)
{
if (process.platform != 'linux') { throw ('Only supported on linux'); }
@@ -30,7 +31,15 @@ function getLibInfo(libname)
var child = require('child_process').execFile('/bin/sh', ['sh']);
child.stdout.str = '';
child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
child.stdin.write("ldconfig -p | grep '" + libname + ".so.'\nexit\n");
child.stdin.write("whereis ldconfig | awk '{ print $2 }'\nexit\n");
child.waitExit();
var ldconfig = child.stdout.str.trim();
child = require('child_process').execFile('/bin/sh', ['sh']);
child.stdout.str = '';
child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
child.stdin.write(ldconfig + " -p | grep '" + libname + ".so.'\nexit\n");
child.waitExit();
var v = [];