From f3a7c097352d5adf30b0bfc0a03cf88ae4744acb Mon Sep 17 00:00:00 2001 From: Per Larsson Date: Tue, 8 Mar 2022 15:45:09 +0100 Subject: Added streaming version of GetCacheChunks. --- zenhttp/websocketasio.cpp | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) (limited to 'zenhttp/websocketasio.cpp') diff --git a/zenhttp/websocketasio.cpp b/zenhttp/websocketasio.cpp index 5a47d0ea9..9b64cc0a5 100644 --- a/zenhttp/websocketasio.cpp +++ b/zenhttp/websocketasio.cpp @@ -659,22 +659,22 @@ WsServer::Run() m_Acceptor->set_option(asio::socket_base::send_buffer_size(SendBufferSize)); #if ZEN_PLATFORM_WINDOWS - // On Windows, loopback connections can take advantage of a faster code path optionally with this flag. - // This must be used by both the client and server side, and is only effective in the absence of - // Windows Filtering Platform (WFP) callouts which can be installed by security software. - // https://docs.microsoft.com/en-us/windows/win32/winsock/sio-loopback-fast-path - SOCKET NativeSocket = m_Acceptor->native_handle(); - int LoopbackOptionValue = 1; - DWORD OptionNumberOfBytesReturned = 0; - WSAIoctl(NativeSocket, - SIO_LOOPBACK_FAST_PATH, - &LoopbackOptionValue, - sizeof(LoopbackOptionValue), - NULL, - 0, - &OptionNumberOfBytesReturned, - 0, - 0); + // On Windows, loopback connections can take advantage of a faster code path optionally with this flag. + // This must be used by both the client and server side, and is only effective in the absence of + // Windows Filtering Platform (WFP) callouts which can be installed by security software. + // https://docs.microsoft.com/en-us/windows/win32/winsock/sio-loopback-fast-path + SOCKET NativeSocket = m_Acceptor->native_handle(); + int LoopbackOptionValue = 1; + DWORD OptionNumberOfBytesReturned = 0; + WSAIoctl(NativeSocket, + SIO_LOOPBACK_FAST_PATH, + &LoopbackOptionValue, + sizeof(LoopbackOptionValue), + NULL, + 0, + &OptionNumberOfBytesReturned, + 0, + 0); #endif asio::error_code Ec; @@ -1589,6 +1589,15 @@ WebSocketService::SendStreamResponse(WebSocketId SocketId, uint32_t CorrelationI SocketServer().SendResponse(std::move(Message)); } +void +WebSocketService::SendStreamResponse(WebSocketId SocketId, uint32_t CorrelationId, CbObject&& StreamResponse) +{ + CbPackage Response; + Response.SetObject(std::move(StreamResponse)); + + SendStreamResponse(SocketId, CorrelationId, std::move(Response)); +} + void WebSocketService::SendStreamCompleteResponse(WebSocketId SocketId, uint32_t CorrelationId) { -- cgit v1.2.3