mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-01-18 19:47:15 +01:00
Minor changes and bugfixes to WS client.
This commit is contained in:
parent
f3d4dab454
commit
05e644b040
@ -56,8 +56,8 @@ void Register_POCO_Net(HSQUIRRELVM vm, Table &)
|
|||||||
);
|
);
|
||||||
// --------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------
|
||||||
ConstTable(vm).Enum(_SC("SqWsSendFlags"), Enumeration(vm)
|
ConstTable(vm).Enum(_SC("SqWsSendFlags"), Enumeration(vm)
|
||||||
.Const(_SC("TEXT"), static_cast< SQInteger >(Poco::Net::WebSocket::FRAME_TEXT))
|
.Const(_SC("Text"), static_cast< SQInteger >(Poco::Net::WebSocket::FRAME_TEXT))
|
||||||
.Const(_SC("BINARY"), static_cast< SQInteger >(Poco::Net::WebSocket::FRAME_BINARY))
|
.Const(_SC("Binary"), static_cast< SQInteger >(Poco::Net::WebSocket::FRAME_BINARY))
|
||||||
);
|
);
|
||||||
// --------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------
|
||||||
ConstTable(vm).Enum(_SC("SqWsStatusCodes"), Enumeration(vm)
|
ConstTable(vm).Enum(_SC("SqWsStatusCodes"), Enumeration(vm)
|
||||||
@ -76,7 +76,7 @@ void Register_POCO_Net(HSQUIRRELVM vm, Table &)
|
|||||||
.Const(_SC("ReservedTlsFailure"), static_cast< SQInteger >(Poco::Net::WebSocket::WS_RESERVED_TLS_FAILURE))
|
.Const(_SC("ReservedTlsFailure"), static_cast< SQInteger >(Poco::Net::WebSocket::WS_RESERVED_TLS_FAILURE))
|
||||||
);
|
);
|
||||||
// --------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------
|
||||||
ConstTable(vm).Enum(_SC("SqWsSendFlags"), Enumeration(vm)
|
ConstTable(vm).Enum(_SC("SqWsErrorCodes"), Enumeration(vm)
|
||||||
.Const(_SC("NoHandshake"), static_cast< SQInteger >(Poco::Net::WebSocket::WS_ERR_NO_HANDSHAKE))
|
.Const(_SC("NoHandshake"), static_cast< SQInteger >(Poco::Net::WebSocket::WS_ERR_NO_HANDSHAKE))
|
||||||
.Const(_SC("HandshakeNoVersion"), static_cast< SQInteger >(Poco::Net::WebSocket::WS_ERR_HANDSHAKE_NO_VERSION))
|
.Const(_SC("HandshakeNoVersion"), static_cast< SQInteger >(Poco::Net::WebSocket::WS_ERR_HANDSHAKE_NO_VERSION))
|
||||||
.Const(_SC("HandshakeUnsupportedVersion"), static_cast< SQInteger >(Poco::Net::WebSocket::WS_ERR_HANDSHAKE_UNSUPPORTED_VERSION))
|
.Const(_SC("HandshakeUnsupportedVersion"), static_cast< SQInteger >(Poco::Net::WebSocket::WS_ERR_HANDSHAKE_UNSUPPORTED_VERSION))
|
||||||
|
@ -136,9 +136,7 @@ struct WsClient
|
|||||||
if (mState != 0)
|
if (mState != 0)
|
||||||
{
|
{
|
||||||
// Create a string with buffer contents
|
// Create a string with buffer contents
|
||||||
LightObj obj(SqTypeIdentity< SqBuffer >{}, SqVM(),
|
LightObj obj(const_cast< const SQChar * >(mBuffer.begin()), static_cast< SQInteger >(mBuffer.sizeBytes()), SqVM());
|
||||||
const_cast< const SQChar * >(mBuffer.begin()),
|
|
||||||
static_cast< SQInteger >(mBuffer.sizeBytes()));
|
|
||||||
// Discard buffer contents for next request
|
// Discard buffer contents for next request
|
||||||
mBuffer.resize(0);
|
mBuffer.resize(0);
|
||||||
// Return the string object
|
// Return the string object
|
||||||
|
Loading…
x
Reference in New Issue
Block a user