[DEBUG] correct an init and check of error in HTTP

This commit is contained in:
Edouard DUPIN 2017-04-28 21:21:25 +02:00
parent 36e7081920
commit d260646f29
2 changed files with 2 additions and 1 deletions

View File

@ -363,7 +363,7 @@ void enet::Http::getHeader() {
bool headerEnded = false;
std::string header;
while (m_connection.getConnectionStatus() == enet::Tcp::status::link) {
char type;
char type = '?';
int32_t len = m_connection.read(&type, 1);
if (len == 0) {
std::this_thread::sleep_for(std::chrono::microseconds(1));

View File

@ -177,6 +177,7 @@ int32_t enet::Tcp::read(void* _data, int32_t _maxLen) {
if (rc == 0) {
ENET_INFO("Connection closed");
closeConn = true;
size = 0;
}
if (closeConn == false) {
// Data was received