https://github.com/venediktov/vanilla-rtb/blob/master/rtb/exchange/exchange_handler.hpp#L129
We have a new feature e.g.
when HTTP 204 is needed we have provided with exchange_handler.if_response() handler which
should be used and custom response should be sent .
The custom response is sent OK however exchange_handler redundantly converts standard response to
wire format causing lag in performance.
Proposing change remove line L129 and add it below
if (auction_response && timer.expires_from_now().total_milliseconds() > 0) {
if(if_response_handler) {
auto custom_reply = if_response_handler(auction_response);
if ( custom_reply ) {
custom_reply(r);
} else {
wire_response = parser.create_response(auction_response);
r << to_string(*wire_response) << http::server::reply::flush("json");
}
} else {
wire_response = parser.create_response(auction_response);
r << to_string(*wire_response) << http::server::reply::flush("json");
}
} else {
r << http::server::reply::flush("json");
}
And looking at it again maybe time to re-factor it as this code is too verbose .
https://github.com/venediktov/vanilla-rtb/blob/master/rtb/exchange/exchange_handler.hpp#L129 We have a new feature e.g. when HTTP 204 is needed we have provided with exchange_handler.if_response() handler which should be used and custom response should be sent . The custom response is sent OK however exchange_handler redundantly converts standard response to wire format causing lag in performance.
Proposing change remove line L129 and add it below
And looking at it again maybe time to re-factor it as this code is too verbose .