use github repo as central

This commit is contained in:
Jackson Tian
2019-01-09 14:07:33 +08:00
parent 9664fb1b00
commit bc0df2dcec
46 changed files with 1864 additions and 29 deletions

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -99,7 +99,7 @@ HttpMessage::HeaderValueType HttpMessage::header(const HeaderNameType & name) co
auto it = headers_.find(name);
if (it != headers_.end())
return it->second;
else
else
return std::string();
}
@@ -161,8 +161,9 @@ void HttpMessage::setBody(const char *data, size_t size)
bodySize_ = 0;
if (size) {
bodySize_ = size;
body_ = new char[size];
body_ = new char[size + 1];
std::copy(data, data + size, body_);
body_[size] = '\0';
}
}