nghttpx: Make initial_addr_idx_ unsigned

This commit is contained in:
Tatsuhiro Tsujikawa 2017-11-04 17:30:56 +09:00
parent 88abbce7e7
commit f5ddd7f43b
3 changed files with 5 additions and 6 deletions

View File

@ -1171,7 +1171,7 @@ ClientHandler::get_downstream_connection(int &err, Downstream *downstream) {
}
dconn =
make_unique<HttpDownstreamConnection>(group, -1, conn_.loop, worker_);
make_unique<HttpDownstreamConnection>(group, 0, conn_.loop, worker_);
}
dconn->set_client_handler(this);

View File

@ -182,7 +182,7 @@ void connectcb(struct ev_loop *loop, ev_io *w, int revents) {
} // namespace
HttpDownstreamConnection::HttpDownstreamConnection(
const std::shared_ptr<DownstreamAddrGroup> &group, ssize_t initial_addr_idx,
const std::shared_ptr<DownstreamAddrGroup> &group, size_t initial_addr_idx,
struct ev_loop *loop, Worker *worker)
: conn_(loop, -1, nullptr, worker->get_mcpool(),
worker->get_downstream_config()->timeout.write,

View File

@ -44,7 +44,7 @@ struct DNSQuery;
class HttpDownstreamConnection : public DownstreamConnection {
public:
HttpDownstreamConnection(const std::shared_ptr<DownstreamAddrGroup> &group,
ssize_t initial_addr_idx, struct ev_loop *loop,
size_t initial_addr_idx, struct ev_loop *loop,
Worker *worker);
virtual ~HttpDownstreamConnection();
virtual int attach_downstream(Downstream *downstream);
@ -109,9 +109,8 @@ private:
IOControl ioctrl_;
http_parser response_htp_;
// Index to backend address. If client affinity is enabled, it is
// the index to affinity_hash. Otherwise, it is the index to the
// backend addresses.
ssize_t initial_addr_idx_;
// the index to affinity_hash. Otherwise, it is 0, and not used.
size_t initial_addr_idx_;
// true if first write of reused connection succeeded. For
// convenience, this is initialized as true.
bool reuse_first_write_done_;