Windows Shell Integration: Don't limit the size of the buffer
authorOlivier Goffart <ogoffart@woboq.com>
Thu, 20 Sep 2018 15:14:05 +0000 (17:14 +0200)
committerMichael Schuster <michael@schuster.ms>
Thu, 20 Aug 2020 16:50:05 +0000 (18:50 +0200)
Otherwise we can't have operation that has many many filename

As reported in #6780

Signed-off-by: Michael Schuster <michael@schuster.ms>
shell_integration/windows/OCContextMenu/OCClientInterface.cpp

index 019ca5c272ab0712cdc103a8fd9a81443f386d3a..f855310e57d60a4e481540dfd8a4fc297389e77c 100644 (file)
@@ -32,7 +32,6 @@
 using namespace std;
 
 #define PIPE_TIMEOUT  5*1000 //ms
-#define SOCK_BUFFER 4096
 
 OCClientInterface::ContextMenuInfo OCClientInterface::FetchInfo(const std::wstring &files)
 {
@@ -92,9 +91,5 @@ void OCClientInterface::SendRequest(const wchar_t *verb, const std::wstring &pat
         return;
     }
 
-    wchar_t msg[SOCK_BUFFER] = { 0 };
-    if (SUCCEEDED(StringCchPrintf(msg, SOCK_BUFFER, L"%s:%s\n", verb, path.c_str())))
-    {
-        socket.SendMsg(msg);
-    }
+    socket.SendMsg((verb + (L":" + path + L"\n")).data());
 }