FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
easyhttpcpp/src/EasyHttpInternal.cpp at master · sony/easyhttpcpp · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
sony
/
easyhttpcpp
Public
Notifications
You must be signed in to change notification settings
Fork
31
Star
176
Code
Issues
11
Pull requests
1
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
easyhttpcpp
/
src
/
EasyHttpInternal.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
116 lines (95 loc) · 3.23 KB
Breadcrumbs
easyhttpcpp
/
src
/
EasyHttpInternal.cpp
Copy path
File metadata and controls
116 lines (95 loc) · 3.23 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
* Copyright 2017 Sony Corporation
*/
#
include
"
easyhttpcpp/common/CoreLogger.h
"
#
include
"
CallInternal.h
"
#
include
"
EasyHttpInternal.h
"
namespace
easyhttpcpp
{
static
const
std::string Tag =
"
EasyHttpInternal
"
;
EasyHttpInternal::EasyHttpInternal
(EasyHttp::Builder& builder) : m_invalidated(
false
)
{
m_pContext =
new
EasyHttpContext
();
m_pContext->
setCache
(builder.
getCache
());
m_pContext->
setTimeoutSec
(builder.
getTimeoutSec
());
m_pContext->
setProxy
(builder.
getProxy
());
m_pContext->
setRootCaDirectory
(builder.
getRootCaDirectory
());
m_pContext->
setRootCaFile
(builder.
getRootCaFile
());
m_pContext->
setCrlCheckPolicy
(builder.
getCrlCheckPolicy
());
m_pContext->
setCallInterceptors
(builder.
getInterceptors
());
m_pContext->
setNetworkInterceptors
(builder.
getNetworkInterceptors
());
m_pContext->
setConnectionPool
(builder.
getConnectionPool
());
m_corePoolSizeOfAsyncThreadPool = builder.
getCorePoolSizeOfAsyncThreadPool
();
m_maximumPoolSizeOfAsyncThreadPool = builder.
getMaximumPoolSizeOfAsyncThreadPool
();
m_pContext->
setHttpExecutionTaskManager
(
new
HttpExecutionTaskManager
(m_corePoolSizeOfAsyncThreadPool,
m_maximumPoolSizeOfAsyncThreadPool));
}
EasyHttpInternal::~EasyHttpInternal
()
{
m_pContext->
getHttpExecutionTaskManager
()->
gracefulShutdown
();
}
Call::Ptr
EasyHttpInternal::newCall
(Request::Ptr pRequest)
{
Poco::FastMutex::ScopedLock
lock
(m_instanceMutex);
if
(m_invalidated) {
EASYHTTPCPP_LOG_D
(Tag,
"
newCall: EasyHttp is already invalidated.
"
);
throw
HttpIllegalStateException
(
"
Need to instantiate EasyHttp object again before calling newCall.
"
);
}
if
(!pRequest) {
EASYHTTPCPP_LOG_D
(Tag,
"
newCall: pRequest is NULL.
"
);
throw
HttpIllegalArgumentException
(
"
newCall require Request.
"
);
}
return
new
CallInternal
(m_pContext, pRequest);
}
Proxy::Ptr
EasyHttpInternal::getProxy
()
const
{
return
m_pContext->
getProxy
();
}
unsigned
int
EasyHttpInternal::getTimeoutSec
()
const
{
return
m_pContext->
getTimeoutSec
();
}
HttpCache::Ptr
EasyHttpInternal::getCache
()
const
{
return
m_pContext->
getCache
();
}
CrlCheckPolicy
EasyHttpInternal::getCrlCheckPolicy
()
const
{
return
m_pContext->
getCrlCheckPolicy
();
}
const
std::string&
EasyHttpInternal::getRootCaDirectory
()
const
{
return
m_pContext->
getRootCaDirectory
();
}
const
std::string&
EasyHttpInternal::getRootCaFile
()
const
{
return
m_pContext->
getRootCaFile
();
}
ConnectionPool::Ptr
EasyHttpInternal::getConnectionPool
()
const
{
return
m_pContext->
getConnectionPool
();
}
EasyHttpContext::Ptr
EasyHttpInternal::getHttpContenxt
()
const
{
return
m_pContext;
}
unsigned
int
EasyHttpInternal::getCorePoolSizeOfAsyncThreadPool
()
const
{
return
m_corePoolSizeOfAsyncThreadPool;
}
unsigned
int
EasyHttpInternal::getMaximumPoolSizeOfAsyncThreadPool
()
const
{
return
m_maximumPoolSizeOfAsyncThreadPool;
}
void
EasyHttpInternal::invalidateAndCancel
()
{
{
Poco::FastMutex::ScopedLock
lock
(m_instanceMutex);
if
(m_invalidated) {
EASYHTTPCPP_LOG_D
(Tag,
"
EasyHttp is already invalidated.
"
);
return
;
}
m_invalidated =
true
;
}
m_pContext->
getHttpExecutionTaskManager
()->
gracefulShutdown
();
}
}
/*
namespace easyhttpcpp
*/
Back
|
FazBrowse Home
|
New Git URL