Skip to content

Commit c492685

Browse files
Merge pull request #46 from jackyding2679/fix-bug
fix bug
2 parents 93a0dde + 5fc4436 commit c492685

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/cos_api.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ bool CosAPI::s_init = false;
1616
bool CosAPI::s_poco_init = false;
1717
int CosAPI::s_cos_obj_num = 0;
1818
SimpleMutex CosAPI::s_init_mutex = SimpleMutex();
19-
boost::threadpool::pool* g_threadpool = NULL;
19+
//boost::threadpool::pool* g_threadpool = NULL;
2020

2121
CosAPI::CosAPI(CosConfig& config)
2222
: m_config(new CosConfig(config)), m_object_op(m_config), m_bucket_op(m_config), m_service_op(m_config) {
@@ -38,7 +38,7 @@ int CosAPI::CosInit() {
3838
s_poco_init = true;
3939
}
4040

41-
g_threadpool = new boost::threadpool::pool(CosSysConfig::GetAsynThreadPoolSize());
41+
//g_threadpool = new boost::threadpool::pool(CosSysConfig::GetAsynThreadPoolSize());
4242
s_init = true;
4343
}
4444

@@ -49,11 +49,11 @@ void CosAPI::CosUInit() {
4949
SimpleMutexLocker locker(&s_init_mutex);
5050
--s_cos_obj_num;
5151
if (s_init && s_cos_obj_num == 0) {
52-
if (g_threadpool){
53-
g_threadpool->wait();
54-
delete g_threadpool;
55-
g_threadpool = NULL;
56-
}
52+
//if (g_threadpool){
53+
// g_threadpool->wait();
54+
// delete g_threadpool;
55+
// g_threadpool = NULL;
56+
//}
5757

5858
s_init = false;
5959
}

src/util/http_sender.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ int HttpSender::SendRequest(const std::string& http_method,
316316
Poco::Net::HTTPRequest req(http_method, path_and_query_str, Poco::Net::HTTPMessage::HTTP_1_1);
317317
for (std::map<std::string, std::string>::const_iterator c_itr = req_headers.begin();
318318
c_itr != req_headers.end(); ++c_itr) {
319-
req.add(c_itr->first, (c_itr->second).c_str());
319+
// 有用户这这里出了堆栈,(c_itr->second).c_str() -> c_itr->second
320+
//req.add(c_itr->first, (c_itr->second).c_str());
321+
req.add(c_itr->first, c_itr->second);
320322
}
321323
req.add("Content-Length", StringUtil::Uint64ToString(req_body.size()));
322324

0 commit comments

Comments
 (0)