Merge branch 'write_big_data'

This commit is contained in:
Links
2017-08-19 21:36:10 +02:00
4 changed files with 61 additions and 7 deletions

View File

@ -528,7 +528,7 @@ void WebSocketsClient::sendHeader(WSclient_t * client) {
handshake += NEW_LINE;
DEBUG_WEBSOCKETS("[WS-Client][sendHeader] handshake %s", (uint8_t*)handshake.c_str());
client->tcp->write((uint8_t*)handshake.c_str(), handshake.length());
write(client, (uint8_t*)handshake.c_str(), handshake.length());
#if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
client->tcp->readStringUntil('\n', &(client->cHttpLine), std::bind(&WebSocketsClient::handleHeader, this, client, &(client->cHttpLine)));
@ -647,7 +647,6 @@ void WebSocketsClient::handleHeader(WSclient_t * client, String * headerLine) {
DEBUG_WEBSOCKETS("[WS-Client][handleHeader] Websocket connection init done.\n");
headerDone(client);
runCbEvent(WStype_CONNECTED, (uint8_t *) client->cUrl.c_str(), client->cUrl.length());
} else if(clientIsConnected(client) && client->isSocketIO && client->cSessionId.length() > 0) {
@ -656,7 +655,7 @@ void WebSocketsClient::handleHeader(WSclient_t * client, String * headerLine) {
DEBUG_WEBSOCKETS("[WS-Client][handleHeader] no Websocket connection close.\n");
_lastConnectionFail = millis();
if(clientIsConnected(client)) {
client->tcp->write("This is a webSocket client!");
write(client, "This is a webSocket client!");
}
clientDisconnect(client);
}