|
@@ -62,11 +62,11 @@ __declspec( dllexport ) bool WebSocketClient::connect()
|
|
{
|
|
{
|
|
Text message = "GET ";
|
|
Text message = "GET ";
|
|
message += path;
|
|
message += path;
|
|
- message += " HTTP/1.1\n";
|
|
|
|
|
|
+ message += " HTTP/1.1\r\n";
|
|
message += "Host: ";
|
|
message += "Host: ";
|
|
message += host;
|
|
message += host;
|
|
- message += "\nUpgrade: websocket\n";
|
|
|
|
- message += "Connection: Upgrade\n";
|
|
|
|
|
|
+ message += "\r\nUpgrade: websocket\r\n";
|
|
|
|
+ message += "Connection: Upgrade\r\n";
|
|
char *key = new char[ 25 ];
|
|
char *key = new char[ 25 ];
|
|
key[ 24 ] = 0;
|
|
key[ 24 ] = 0;
|
|
key[ 23 ] = '=';
|
|
key[ 23 ] = '=';
|
|
@@ -76,7 +76,7 @@ __declspec( dllexport ) bool WebSocketClient::connect()
|
|
message += "Sec-WebSocket-Key: ";
|
|
message += "Sec-WebSocket-Key: ";
|
|
message += key;
|
|
message += key;
|
|
delete[] key;
|
|
delete[] key;
|
|
- message += "\nSec-WebSocket-Version: 13\n\n";
|
|
|
|
|
|
+ message += "\r\nSec-WebSocket-Version: 13\r\n\r\n";
|
|
klient = new Klient();
|
|
klient = new Klient();
|
|
if( !klient->verbinde( port, host ) )
|
|
if( !klient->verbinde( port, host ) )
|
|
{
|
|
{
|
|
@@ -357,6 +357,7 @@ __declspec( dllexport ) void WebSocketClient::thread()
|
|
{
|
|
{
|
|
if( nextClose )
|
|
if( nextClose )
|
|
{
|
|
{
|
|
|
|
+ c.unlock();
|
|
c2.lock();
|
|
c2.lock();
|
|
klient->trenne();
|
|
klient->trenne();
|
|
klient = klient->release();
|
|
klient = klient->release();
|