Skip to content

Commit

Permalink
Merge pull request #158 from mazgch/fixes_for_arduino_esp32_v3.0.0
Browse files Browse the repository at this point in the history
Fixes for arduino esp32 v3.0.0
  • Loading branch information
gilmaimon authored Jun 3, 2024
2 parents 917809c + 662d6ab commit d89b200
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/tiny_websockets/network/esp32/esp32_tcp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <tiny_websockets/network/generic_esp/generic_esp_clients.hpp>

#include <WiFi.h>
#include <WiFiClientSecure.h>
#include <HTTPClient.h>

namespace websockets { namespace network {
Expand Down
2 changes: 1 addition & 1 deletion src/websockets_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ namespace websockets {
#ifndef _WS_CONFIG_SKIP_HANDSHAKE_ACCEPT_VALIDATION
result.expectedAcceptKey = crypto::websocketsHandshakeEncodeKey(key);
#endif
return std::move(result);
return result;
}

bool isWhitespace(char ch) {
Expand Down
8 changes: 4 additions & 4 deletions src/websockets_endpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ namespace internals {

done_reading += numReceived;
}
return std::move(data);
return data;
}

void remaskData(WSString& data, const uint8_t* const maskingKey, uint64_t payloadLength) {
Expand Down Expand Up @@ -233,14 +233,14 @@ namespace internals {
frame.opcode = header.opcode;
frame.payload_length = payloadLength;

return std::move(frame);
return frame;
}

WebsocketsMessage WebsocketsEndpoint::handleFrameInStreamingMode(WebsocketsFrame& frame) {
if(frame.isControlFrame()) {
auto msg = WebsocketsMessage::CreateFromFrame(std::move(frame));
this->handleMessageInternally(msg);
return std::move(msg);
return msg;
}
else if(frame.isBeginningOfFragmentsStream()) {
this->_recvMode = RecvMode_Streaming;
Expand Down Expand Up @@ -293,7 +293,7 @@ namespace internals {
if(frame.isNormalUnfragmentedMessage() || frame.isControlFrame()) {
auto msg = WebsocketsMessage::CreateFromFrame(std::move(frame));
this->handleMessageInternally(msg);
return std::move(msg);
return msg;
}
else if(frame.isBeginningOfFragmentsStream()) {
return handleFrameInStreamingMode(frame);
Expand Down

0 comments on commit d89b200

Please sign in to comment.