mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-07-14 15:56:30 +02:00
bump version
optimize String usage (less malloc / realloc) remove double debug line
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
name=WebSockets
|
name=WebSockets
|
||||||
version=1.0
|
version=1.1
|
||||||
author=Markus Sattler
|
author=Markus Sattler
|
||||||
maintainer=Markus Sattler
|
maintainer=Markus Sattler
|
||||||
sentence=WebSockets for Arduino (Server + Client)
|
sentence=WebSockets for Arduino (Server + Client)
|
||||||
|
@ -272,25 +272,22 @@ void WebSocketsClient::sendHeader(WSclient_t * client) {
|
|||||||
|
|
||||||
unsigned long start = micros();
|
unsigned long start = micros();
|
||||||
|
|
||||||
String handshake;
|
String handshake = "GET " + client->cUrl + " HTTP/1.1\r\n"
|
||||||
handshake="GET "+client->cUrl+" HTTP/1.1\r\n";
|
"Host: " + _host + "\r\n"
|
||||||
handshake+="Host: "+_host+"\r\n";
|
"Upgrade: websocket\r\n"
|
||||||
handshake+="Upgrade: websocket\r\n";
|
"Connection: Upgrade\r\n"
|
||||||
handshake+="Connection: Upgrade\r\n";
|
"User-Agent: arduino-WebSocket-Client\r\n"
|
||||||
handshake+="User-Agent: arduino-WebSocket-Client\r\n";
|
"Sec-WebSocket-Version: 13\r\n"
|
||||||
handshake+="Sec-WebSocket-Version: 13\r\n";
|
"Sec-WebSocket-Protocol: arduino\r\n"
|
||||||
handshake+="Sec-WebSocket-Protocol: arduino\r\n";
|
"Sec-WebSocket-Key: " + client->cKey + "\r\n";
|
||||||
handshake+="Sec-WebSocket-Key: "+client->cKey+"\r\n";
|
|
||||||
|
if(client->cExtensions.length() > 0) {
|
||||||
if(client->cExtensions.length() > 0) {
|
handshake += "Sec-WebSocket-Extensions: " + client->cExtensions + "\r\n";
|
||||||
handshake+="Sec-WebSocket-Extensions: "+client->cExtensions+"\r\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handshake+="\r\n";
|
|
||||||
client->tcp.write(handshake.c_str(), handshake.length());
|
|
||||||
|
|
||||||
DEBUG_WEBSOCKETS("[WS-Client][sendHeader] sending header... Done (%uus).\n", (micros() - start));
|
handshake += "\r\n";
|
||||||
|
|
||||||
|
client->tcp.write(handshake.c_str(), handshake.length());
|
||||||
|
|
||||||
DEBUG_WEBSOCKETS("[WS-Client][sendHeader] sending header... Done (%uus).\n", (micros() - start));
|
DEBUG_WEBSOCKETS("[WS-Client][sendHeader] sending header... Done (%uus).\n", (micros() - start));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user