diff --git a/README.md b/README.md index e17d8ce..a8d6f98 100644 --- a/README.md +++ b/README.md @@ -254,4 +254,4 @@ CPP11实现 ------------ Linux高性能服务器编程,游双著. -感谢以下朋友的PR和帮助: [@RownH](https://github.com/RownH),[@mapleFU](https://github.com/mapleFU),[@ZWiley](https://github.com/ZWiley),[@zjuHong](https://github.com/zjuHong),[@mamil](https://github.com/mamil),[@byfate](https://github.com/byfate),[@MaJun827](https://github.com/MaJun827),[@BBLiu-coder](https://github.com/BBLiu-coder),[@smoky96](https://github.com/smoky96),[@yfBong](https://github.com/yfBong),[@liuwuyao](https://github.com/liuwuyao),[@Huixxi](https://github.com/Huixxi),[@markparticle](https://github.com/markparticle). +感谢以下朋友的PR和帮助: [@RownH](https://github.com/RownH),[@mapleFU](https://github.com/mapleFU),[@ZWiley](https://github.com/ZWiley),[@zjuHong](https://github.com/zjuHong),[@mamil](https://github.com/mamil),[@byfate](https://github.com/byfate),[@MaJun827](https://github.com/MaJun827),[@BBLiu-coder](https://github.com/BBLiu-coder),[@smoky96](https://github.com/smoky96),[@yfBong](https://github.com/yfBong),[@liuwuyao](https://github.com/liuwuyao),[@Huixxi](https://github.com/Huixxi),[@markparticle](https://github.com/markparticle),[@ning2510](https://github.com/ning2510). diff --git a/http/http_conn.cpp b/http/http_conn.cpp index a359ab4..c0aa93b 100644 --- a/http/http_conn.cpp +++ b/http/http_conn.cpp @@ -549,7 +549,7 @@ bool http_conn::write() bytes_have_send += temp; bytes_to_send -= temp; - if (bytes_have_send >= m_iv[0].iov_len) + if (bytes_have_send >= m_write_idx) { m_iv[0].iov_len = 0; m_iv[1].iov_base = m_file_address + (bytes_have_send - m_write_idx); @@ -558,7 +558,7 @@ bool http_conn::write() else { m_iv[0].iov_base = m_write_buf + bytes_have_send; - m_iv[0].iov_len = m_iv[0].iov_len - bytes_have_send; + m_iv[0].iov_len = m_write_idx - bytes_have_send; } if (bytes_to_send <= 0)