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:
@@ -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
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user