nghttp: Call on_read() to process all data in buffer after upgrade succeeded

This commit is contained in:
Tatsuhiro Tsujikawa 2013-08-04 18:43:10 +09:00
parent d132427788
commit 690349009d
1 changed files with 6 additions and 0 deletions

View File

@ -585,6 +585,12 @@ struct HttpClient {
if(rv != 0) {
return rv;
}
// Read remaining data in the buffer because it is not
// notified callback anymore.
rv = on_read();
if(rv != 0) {
return rv;
}
} else {
std::cerr << "HTTP Upgrade failed" << std::endl;
return -1;