nghttpx: Process buffered data first without reading additional data
This commit is contained in:
parent
b9174b828e
commit
d1391f1db7
|
@ -97,9 +97,13 @@ int ClientHandler::read_clear() {
|
||||||
ev_timer_again(loop_, &rt_);
|
ev_timer_again(loop_, &rt_);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
// we should process buffered data first before we read EOF.
|
||||||
if (rb_.rleft() && on_read() != 0) {
|
if (rb_.rleft() && on_read() != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (rb_.rleft()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
rb_.reset();
|
rb_.reset();
|
||||||
struct iovec iov[2];
|
struct iovec iov[2];
|
||||||
auto iovcnt = rb_.wiovec(iov);
|
auto iovcnt = rb_.wiovec(iov);
|
||||||
|
@ -222,10 +226,13 @@ int ClientHandler::read_tls() {
|
||||||
ev_timer_again(loop_, &rt_);
|
ev_timer_again(loop_, &rt_);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
// we should process buffered data first before we read EOF.
|
||||||
if (rb_.rleft() && on_read() != 0) {
|
if (rb_.rleft() && on_read() != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (rb_.rleft()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
rb_.reset();
|
rb_.reset();
|
||||||
struct iovec iov[2];
|
struct iovec iov[2];
|
||||||
auto iovcnt = rb_.wiovec(iov);
|
auto iovcnt = rb_.wiovec(iov);
|
||||||
|
|
|
@ -1537,9 +1537,13 @@ int Http2Session::read_clear() {
|
||||||
ev_timer_again(loop_, &rt_);
|
ev_timer_again(loop_, &rt_);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
// we should process buffered data first before we read EOF.
|
||||||
if (rb_.rleft() && on_read() != 0) {
|
if (rb_.rleft() && on_read() != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (rb_.rleft()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
rb_.reset();
|
rb_.reset();
|
||||||
struct iovec iov[2];
|
struct iovec iov[2];
|
||||||
auto iovcnt = rb_.wiovec(iov);
|
auto iovcnt = rb_.wiovec(iov);
|
||||||
|
@ -1661,10 +1665,13 @@ int Http2Session::read_tls() {
|
||||||
ev_timer_again(loop_, &rt_);
|
ev_timer_again(loop_, &rt_);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
// we should process buffered data first before we read EOF.
|
||||||
if (rb_.rleft() && on_read() != 0) {
|
if (rb_.rleft() && on_read() != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (rb_.rleft()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
rb_.reset();
|
rb_.reset();
|
||||||
struct iovec iov[2];
|
struct iovec iov[2];
|
||||||
auto iovcnt = rb_.wiovec(iov);
|
auto iovcnt = rb_.wiovec(iov);
|
||||||
|
|
Loading…
Reference in New Issue