| 332 | } |
| 333 | |
| 334 | void https_client::one_second_timer() { |
| 335 | if (!tcp_connect_done && time(nullptr) >= timeout) { |
| 336 | timed_out = true; |
| 337 | this->close(); |
| 338 | } else if (tcp_connect_done && !connected && time(nullptr) >= timeout && this->state != HTTPS_DONE) { |
| 339 | this->close(); |
| 340 | timed_out = true; |
| 341 | } else if (time(nullptr) >= timeout && this->state != HTTPS_DONE) { |
| 342 | this->close(); |
| 343 | timed_out = true; |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | void https_client::close() { |
| 348 | if (state != HTTPS_DONE) { |