mirror of https://gitee.com/bigwinds/arangodb
fix compile warning
This commit is contained in:
parent
e75b8f5503
commit
0bfe4473ee
|
@ -220,7 +220,8 @@ int Communicator::work_once() {
|
|||
void Communicator::wait() {
|
||||
static int const MAX_WAIT_MSECS = 1000; // wait max. 1 seconds
|
||||
|
||||
int res = curl_multi_wait(_curl, &_wakeup, 1, MAX_WAIT_MSECS, &_numFds);
|
||||
int numFds; // not used here
|
||||
int res = curl_multi_wait(_curl, &_wakeup, 1, MAX_WAIT_MSECS, &numFds);
|
||||
if (res != CURLM_OK) {
|
||||
throw std::runtime_error(
|
||||
"Invalid curl multi result while waiting! Result was " +
|
||||
|
@ -377,8 +378,7 @@ void Communicator::handleResult(CURL* handle, CURLcode rc) {
|
|||
std::string prefix("Communicator(" + std::to_string(rip->_ticketId) +
|
||||
") // ");
|
||||
LOG_TOPIC(TRACE, Logger::REQUESTS)
|
||||
<< prefix << "Curl rc is : " << rc << " after " << std::fixed
|
||||
<< (TRI_microtime() - rip->_startTime) << "s";
|
||||
<< prefix << "Curl rc is : " << rc << " after " << Logger::FIXED(TRI_microtime() - rip->_startTime) << " s";
|
||||
if (strlen(rip->_errorBuffer) != 0) {
|
||||
LOG_TOPIC(TRACE, Logger::REQUESTS)
|
||||
<< prefix << "Curl error details: " << rip->_errorBuffer;
|
||||
|
|
|
@ -50,6 +50,7 @@ struct RequestInProgress {
|
|||
_ticketId(ticketId),
|
||||
_requestBody(requestBody),
|
||||
_requestHeaders(nullptr),
|
||||
_startTime(0.0),
|
||||
_responseBody(new StringBuffer(TRI_UNKNOWN_MEM_ZONE, false)),
|
||||
_options(options) {
|
||||
_errorBuffer[0] = '\0';
|
||||
|
@ -147,8 +148,6 @@ class Communicator {
|
|||
int _fds[2];
|
||||
#endif
|
||||
|
||||
int _numFds;
|
||||
|
||||
private:
|
||||
void createRequestInProgress(NewRequest const& newRequest);
|
||||
void handleResult(CURL*, CURLcode);
|
||||
|
|
|
@ -29,6 +29,9 @@ namespace arangodb {
|
|||
namespace httpclient {
|
||||
|
||||
class SimpleHttpCommunicatorResult: public SimpleHttpResult {
|
||||
using SimpleHttpResult::getBody;
|
||||
using SimpleHttpResult::getBodyVelocyPack;
|
||||
|
||||
public:
|
||||
SimpleHttpCommunicatorResult() = delete;
|
||||
explicit SimpleHttpCommunicatorResult(HttpResponse* response)
|
||||
|
@ -42,8 +45,8 @@ class SimpleHttpCommunicatorResult: public SimpleHttpResult {
|
|||
virtual std::string getHttpReturnMessage() const override { return GeneralResponse::responseString(_response->responseCode()); }
|
||||
virtual bool hasContentLength() const override { return true; }
|
||||
virtual size_t getContentLength() const override { return _response->body().length(); }
|
||||
virtual arangodb::basics::StringBuffer& getBody() override { return _response->body(); }
|
||||
virtual std::shared_ptr<VPackBuilder> getBodyVelocyPack(VPackOptions const& options) const override {
|
||||
arangodb::basics::StringBuffer& getBody() override { return _response->body(); }
|
||||
std::shared_ptr<VPackBuilder> getBodyVelocyPack(VPackOptions const& options) const override {
|
||||
return VPackParser::fromJson(_response->body().c_str(), _response->body().length(), &options);
|
||||
}
|
||||
virtual enum resultTypes getResultType() const override {
|
||||
|
|
Loading…
Reference in New Issue