Skip to content

Commit

Permalink
x0d: adapted to changes in http api
Browse files Browse the repository at this point in the history
  • Loading branch information
christianparpart committed Aug 3, 2014
1 parent fc42fd4 commit 02c87d1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 26 deletions.
12 changes: 3 additions & 9 deletions src/plugins/director/FastCgiBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ class FastCgiBackend::Connection : // {{{
bool onMessageContent(const BufferRef& content) override;

// proxy logging
void log(LogMessage&& msg) override;
template <typename... Args>
void log(Severity severity, const char* fmt, Args&&... args);

Expand Down Expand Up @@ -854,17 +853,12 @@ bool FastCgiBackend::Connection::onMessageContent(const BufferRef& chunk) {
return true;
}

void FastCgiBackend::Connection::log(LogMessage&& msg) {
if (rn_) {
msg.addTag("fastcgi/%d", transportId_);
rn_->request->log(std::move(msg));
}
}

template <typename... Args>
inline void FastCgiBackend::Connection::log(Severity severity, const char* fmt,
Args&&... args) {
log(LogMessage(severity, fmt, args...));
if (rn_) {
rn_->request->log(severity, fmt, std::forward<Args>(args)...);
}
}

void FastCgiBackend::Connection::inspect(Buffer& out) {
Expand Down
5 changes: 0 additions & 5 deletions src/plugins/director/HealthMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,6 @@ void HealthMonitor::logFailure() {
recheck();
}

void HealthMonitor::log(LogMessage&& msg) {
msg.addTag("monitor");
backend_->manager()->log(std::move(msg));
}

/**
* Callback, invoked on successfully parsed response status line.
*/
Expand Down
1 change: 0 additions & 1 deletion src/plugins/director/HealthMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ class HealthMonitor : protected base::Logging,
const base::BufferRef& value) override;
bool onMessageContent(const base::BufferRef& chunk) override;
bool onMessageEnd() override;
void log(base::LogMessage&& msg) override;
};

base::JsonWriter& operator<<(base::JsonWriter& json,
Expand Down
15 changes: 4 additions & 11 deletions src/plugins/director/HttpBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <netdb.h>

#if !defined(NDEBUG)
#define TRACE(msg...) (this->log(LogMessage(Severity::trace1, msg)))
#define TRACE(msg...) (this->log(Severity::trace1, msg))
#else
#define TRACE(msg...) \
do { \
Expand Down Expand Up @@ -92,8 +92,6 @@ class HttpBackend::Connection :
bool onMessageContent(const BufferRef& chunk) override;
bool onMessageEnd() override;

void log(LogMessage&& msg) override;

template <typename... Args>
void log(Severity severity, const char* fmt, Args&&... args);

Expand Down Expand Up @@ -478,17 +476,12 @@ bool HttpBackend::Connection::onMessageEnd() {
return false;
}

void HttpBackend::Connection::log(LogMessage&& msg) {
if (rn_) {
msg.addTag("http-backend");
rn_->request->log(std::move(msg));
}
}

template <typename... Args>
inline void HttpBackend::Connection::log(Severity severity, const char* fmt,
Args&&... args) {
log(LogMessage(severity, fmt, args...));
if (rn_) {
rn_->request->log(severity, fmt, std::forward<Args>(args)...);
}
}

void HttpBackend::Connection::onReadWriteReady(Socket* s, int revents) {
Expand Down

0 comments on commit 02c87d1

Please sign in to comment.