9
9
class ServerErrorHandler : public REQUEST_HANDLER
10
10
{
11
11
public:
12
- ServerErrorHandler (IHttpContext& pContext, USHORT statusCode, USHORT subStatusCode, std::string statusText, HRESULT hr, HINSTANCE module , bool disableStartupPage, BYTE* content, int length ) noexcept
13
- : ServerErrorHandler(pContext, statusCode, subStatusCode, statusText, hr, module , disableStartupPage, 0 , content, length)
12
+ ServerErrorHandler (IHttpContext& pContext, USHORT statusCode, USHORT subStatusCode, const std::string& statusText, HRESULT hr, HINSTANCE module , bool disableStartupPage, int page ) noexcept
13
+ : ServerErrorHandler(pContext, statusCode, subStatusCode, statusText, hr, module , disableStartupPage, page, std::vector<byte>())
14
14
{
15
15
}
16
16
17
- ServerErrorHandler (IHttpContext& pContext, USHORT statusCode, USHORT subStatusCode, std::string statusText, HRESULT hr, HINSTANCE module , bool disableStartupPage, int page) noexcept
18
- : ServerErrorHandler(pContext, statusCode, subStatusCode, statusText, hr, module , disableStartupPage, page, nullptr , 0 )
19
- {
20
- }
21
-
22
- ServerErrorHandler (IHttpContext& pContext, USHORT statusCode, USHORT subStatusCode, std::string statusText, HRESULT hr, HINSTANCE module , bool disableStartupPage, int page, BYTE* content, int length) noexcept
17
+ ServerErrorHandler (IHttpContext& pContext, USHORT statusCode, USHORT subStatusCode, const std::string& statusText, HRESULT hr, HINSTANCE module , bool disableStartupPage, int page, const std::vector<byte>& content) noexcept
23
18
: REQUEST_HANDLER(pContext),
24
19
m_pContext (pContext),
25
20
m_HR(hr),
@@ -29,7 +24,6 @@ class ServerErrorHandler : public REQUEST_HANDLER
29
24
m_statusText(std::move(statusText)),
30
25
m_page(page),
31
26
m_ExceptionInfoContent(content),
32
- m_length(length),
33
27
m_moduleInstance(module )
34
28
{
35
29
}
@@ -60,10 +54,10 @@ class ServerErrorHandler : public REQUEST_HANDLER
60
54
);
61
55
62
56
dataChunk.DataChunkType = HttpDataChunkFromMemory;
63
- if (m_length > 0 )
57
+ if (m_ExceptionInfoContent. size () > 0 )
64
58
{
65
- dataChunk.FromMemory .pBuffer = m_ExceptionInfoContent;
66
- dataChunk.FromMemory .BufferLength = static_cast <ULONG>(m_length );
59
+ dataChunk.FromMemory .pBuffer = & m_ExceptionInfoContent[ 0 ] ;
60
+ dataChunk.FromMemory .BufferLength = static_cast <ULONG>(m_ExceptionInfoContent. size () );
67
61
}
68
62
else
69
63
{
@@ -117,6 +111,5 @@ class ServerErrorHandler : public REQUEST_HANDLER
117
111
USHORT m_statusCode;
118
112
USHORT m_subStatusCode;
119
113
std::string m_statusText;
120
- BYTE* m_ExceptionInfoContent;
121
- int m_length;
114
+ std::vector<byte> m_ExceptionInfoContent;
122
115
};
0 commit comments