forked from tjanczuk/iisnode
/
cnodehttpstoredcontext.h
91 lines (81 loc) · 2.52 KB
/
cnodehttpstoredcontext.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef __CNODEHTTPSTOREDCONTEXT_H__
#define __CNODEHTTPSTOREDCONTEXT_H__
class CNodeApplication;
class CNodeProcess;
class CNodeHttpStoredContext : public IHttpStoredContext
{
private:
GUID activityId;
CNodeApplication* nodeApplication;
IHttpContext* context;
ASYNC_CONTEXT asyncContext;
CNodeProcess* process;
HANDLE pipe;
DWORD connectionRetryCount;
void* buffer;
DWORD bufferSize;
DWORD dataSize;
DWORD parsingOffset;
LONGLONG chunkTransmitted;
LONGLONG chunkLength;
BOOL isChunked;
HRESULT result;
REQUEST_NOTIFICATION_STATUS requestNotificationStatus;
long pendingAsyncOperationCount;
PCSTR targetUrl;
DWORD targetUrlLength;
IHttpContext* childContext;
BOOL isLastChunk;
BOOL isConnectionFromPool;
public:
// Context is owned by the caller
CNodeHttpStoredContext(CNodeApplication* nodeApplication, IHttpContext* context);
~CNodeHttpStoredContext();
IHttpContext* GetHttpContext();
CNodeApplication* GetNodeApplication();
LPOVERLAPPED GetOverlapped();
CNodeProcess* GetNodeProcess();
ASYNC_CONTEXT* GetAsyncContext();
HANDLE GetPipe();
DWORD GetConnectionRetryCount();
void* GetBuffer();
DWORD GetBufferSize();
void** GetBufferRef();
DWORD* GetBufferSizeRef();
DWORD GetDataSize();
DWORD GetParsingOffset();
LONGLONG GetChunkTransmitted();
LONGLONG GetChunkLength();
BOOL GetIsChunked();
void SetIsLastChunk(BOOL lastChunk);
BOOL GetIsLastChunk();
HRESULT GetHresult();
REQUEST_NOTIFICATION_STATUS GetRequestNotificationStatus();
GUID* GetActivityId();
PCSTR GetTargetUrl();
DWORD GetTargetUrlLength();
void SetTargetUrl(PCSTR targetUrl, DWORD targetUrlLength);
void SetChildContext(IHttpContext* context);
IHttpContext* GetChildContext();
void SetNextProcessor(LPOVERLAPPED_COMPLETION_ROUTINE processor);
void SetNodeProcess(CNodeProcess* process);
void SetPipe(HANDLE pipe);
void SetConnectionRetryCount(DWORD count);
void SetBuffer(void* buffer);
void SetBufferSize(DWORD bufferSize);
void SetDataSize(DWORD dataSize);
void SetParsingOffset(DWORD parsingOffet);
void SetChunkTransmitted(LONGLONG length);
void SetChunkLength(LONGLONG length);
void SetIsChunked(BOOL chunked);
void SetHresult(HRESULT result);
void SetRequestNotificationStatus(REQUEST_NOTIFICATION_STATUS status);
LPOVERLAPPED InitializeOverlapped();
long IncreasePendingAsyncOperationCount();
long DecreasePendingAsyncOperationCount();
BOOL GetIsConnectionFromPool();
void SetIsConnectionFromPool(BOOL fromPool);
static CNodeHttpStoredContext* Get(LPOVERLAPPED overlapped);
virtual void CleanupStoredContext();
};
#endif