wsd/LOOLWSD.cpp |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit 848bacaa7f9bd7e55b4c088059cc9d0799fa2bdc
Author:     Michael Meeks <michael.me...@collabora.com>
AuthorDate: Mon Jun 8 14:43:04 2020 +0100
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Mon Jun 8 16:06:57 2020 +0200

    Proxy: shutdown socket with error if we can't find documentbroker.
    
    Also called if/as/when the document is unloading as you connect.
    
    Change-Id: I494dc207219298e07fba664cd2cbdd5d5b8ac889
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95809
    Tested-by: Jenkins
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>

diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index f2c01965e..457e109b5 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -3016,6 +3016,21 @@ private:
                         });
                 });
         }
+        else
+        {
+            auto streamSocket = 
std::static_pointer_cast<StreamSocket>(disposition.getSocket());
+            LOG_ERR("Failed to find document");
+            // badness occurred:
+            std::ostringstream oss;
+            oss << "HTTP/1.1 400\r\n"
+                << "Date: " << Util::getHttpTimeNow() << "\r\n"
+                << "User-Agent: LOOLWSD WOPI Agent\r\n"
+                << "Content-Length: \r\n"
+                << "\r\n";
+            // FIXME: send docunloading & re-try on client ?
+            streamSocket->send(oss.str());
+            streamSocket->shutdown();
+        }
     }
 
     void handleClientWsUpgrade(const Poco::Net::HTTPRequest& request,
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to