Commit f46f6cddfae27bf76dc13e873f7271d6523698b9
Committed by
Moritz Wirger
1 parent
4a70df95
reduce scope of bytesReceived in LinHttpHandler
Showing
1 changed file
with
1 additions
and
2 deletions
hueplusplus/LinHttpHandler.cpp
| ... | ... | @@ -178,12 +178,11 @@ std::vector<std::string> LinHttpHandler::sendMulticast(const std::string & msg, |
| 178 | 178 | |
| 179 | 179 | std::string response; |
| 180 | 180 | char buffer[2048] = {}; // receive buffer |
| 181 | - ssize_t bytesReceived = 0; | |
| 182 | 181 | |
| 183 | 182 | std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now(); |
| 184 | 183 | while (std::chrono::steady_clock::now() - start < std::chrono::seconds(timeout)) |
| 185 | 184 | { |
| 186 | - bytesReceived = recv(socketFD, &buffer, 2048, MSG_DONTWAIT); | |
| 185 | + ssize_t bytesReceived = recv(socketFD, &buffer, 2048, MSG_DONTWAIT); | |
| 187 | 186 | if (bytesReceived < 0) |
| 188 | 187 | { |
| 189 | 188 | int errCode = errno; | ... | ... |