Do not buy secondary without enough money on not first round.

This commit is contained in:
jeefo 2019-09-05 10:44:08 +03:00
commit 9720a63401
4 changed files with 12 additions and 8 deletions

View file

@ -198,7 +198,9 @@ namespace detail {
// simple http client for downloading/uploading files only
class HttpClient final : public Singleton <HttpClient> {
private:
static constexpr int32 kMaxRecvErrors = 12;
enum : int32 {
MaxReceiveErrors = 12
};
private:
Socket m_socket;
@ -218,7 +220,7 @@ private:
// prase response header
while (!isFinished && pos < m_chunkSize) {
if (m_socket.recv (&buffer[pos], 1) < 1) {
if (++errors > kMaxRecvErrors) {
if (++errors > MaxReceiveErrors) {
isFinished = true;
}
else {