| 1560 | } |
| 1561 | |
| 1562 | SC::Result SC::HttpClientOperation::poll(uint32_t timeoutMilliseconds) |
| 1563 | { |
| 1564 | SC_TRY_MSG(initialized, "HttpClientOperation: not initialized"); |
| 1565 | |
| 1566 | SC_TRY(processPendingEvents()); |
| 1567 | if (timeoutMilliseconds == 0 or not requestInFlight) |
| 1568 | { |
| 1569 | return Result(true); |
| 1570 | } |
| 1571 | |
| 1572 | eventMutex.lock(); |
| 1573 | while (requestInFlight and eventCount == 0) |
| 1574 | { |
| 1575 | if (not eventCV.wait(eventMutex, timeoutMilliseconds)) |
| 1576 | { |
| 1577 | eventMutex.unlock(); |
| 1578 | return Result(true); |
| 1579 | } |
| 1580 | } |
| 1581 | eventMutex.unlock(); |
| 1582 | |
| 1583 | return processPendingEvents(); |
| 1584 | } |
| 1585 | |
| 1586 | void SC::HttpClientOperation::resetResponseState(HttpClientResponse& response) |
| 1587 | { |