wsd/LOOLWSD.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
New commits: commit 998473fa7fe6dfb68f202a464a1bb12d417d92a2 Author: Jan Holesovsky <ke...@collabora.com> Date: Thu Apr 20 17:42:31 2017 +0200 Revert "wsd: clear the incoming buffer before upgrading to WS" This fixes image insertion. This reverts commit 9a761ffe68b24e180dd74c0737e20cabe9dc9e1b. Change-Id: I05c88b96e40fce820a75738485fe8599129d3e20 diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp index d109e5d2..b4db3636 100644 --- a/wsd/LOOLWSD.cpp +++ b/wsd/LOOLWSD.cpp @@ -1533,7 +1533,6 @@ private: { auto socket = _socket.lock(); std::vector<char>& in = socket->_inBuffer; - LOG_TRC("#" << socket->getFD() << " handling incoming " << in.size() << " bytes."); // Find the end of the header, if any. static const std::string marker("\r\n\r\n"); @@ -1541,7 +1540,7 @@ private: marker.begin(), marker.end()); if (itBody == in.end()) { - LOG_DBG("#" << socket->getFD() << " doesn't have enough data yet."); + LOG_TRC("#" << socket->getFD() << " doesn't have enough data yet."); return SocketHandlerInterface::SocketOwnership::UNCHANGED; } @@ -1579,10 +1578,6 @@ private: LOG_DBG("Not enough content yet: ContentLength: " << contentLength << ", available: " << available); return SocketHandlerInterface::SocketOwnership::UNCHANGED; } - - // if we succeeded - remove the request from our input buffer - // we expect one request per socket - in.erase(in.begin(), itBody); } catch (const std::exception& exc) { @@ -1639,8 +1634,7 @@ private: // All post requests have url prefix 'lool'. socketOwnership = handlePostRequest(request, message); } - else if (reqPathTokens.count() > 2 && reqPathTokens[0] == "lool" && reqPathTokens[2] == "ws" && - request.find("Upgrade") != request.end() && Poco::icompare(request["Upgrade"], "websocket") == 0) + else if (reqPathTokens.count() > 2 && reqPathTokens[0] == "lool" && reqPathTokens[2] == "ws") { socketOwnership = handleClientWsUpgrade(request, reqPathTokens[1]); } @@ -1659,6 +1653,10 @@ private: socket->shutdown(); } } + + // if we succeeded - remove the request from our input buffer + // we expect one request per socket + in.clear(); } catch (const std::exception& exc) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits