nghttpx: Define max iovcnt for http1 backend write operation
This commit is contained in:
parent
91b40d1e84
commit
987aa2dd85
|
@ -689,14 +689,23 @@ int HttpDownstreamConnection::on_read() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define DEFAULT_WR_IOVCNT 16
|
||||||
|
|
||||||
|
#if defined(IOV_MAX) && IOV_MAX < DEFAULT_WR_IOVCNT
|
||||||
|
#define MAX_WR_IOVCNT IOV_MAX
|
||||||
|
#else // !defined(IOV_MAX) || IOV_MAX >= DEFAULT_WR_IOVCNT
|
||||||
|
#define MAX_WR_IOVCNT DEFAULT_WR_IOVCNT
|
||||||
|
#endif // !defined(IOV_MAX) || IOV_MAX >= DEFAULT_WR_IOVCNT
|
||||||
|
|
||||||
int HttpDownstreamConnection::on_write() {
|
int HttpDownstreamConnection::on_write() {
|
||||||
ev_timer_again(loop_, &rt_);
|
ev_timer_again(loop_, &rt_);
|
||||||
|
|
||||||
auto upstream = downstream_->get_upstream();
|
auto upstream = downstream_->get_upstream();
|
||||||
auto input = downstream_->get_request_buf();
|
auto input = downstream_->get_request_buf();
|
||||||
|
|
||||||
|
struct iovec iov[MAX_WR_IOVCNT];
|
||||||
|
|
||||||
while (input->rleft() > 0) {
|
while (input->rleft() > 0) {
|
||||||
struct iovec iov[2];
|
|
||||||
auto iovcnt = input->riovec(iov, util::array_size(iov));
|
auto iovcnt = input->riovec(iov, util::array_size(iov));
|
||||||
|
|
||||||
ssize_t nwrite;
|
ssize_t nwrite;
|
||||||
|
|
Loading…
Reference in New Issue