| 1027 | } |
| 1028 | |
| 1029 | SC::Result SC::HttpClientSession::beginRetry(HttpClientSessionRetryState& state, const HttpClientRequest& request, |
| 1030 | HttpClientSessionRetryPolicy policy) const |
| 1031 | { |
| 1032 | SC_TRY_MSG(initialized, "HttpClientSession: not initialized"); |
| 1033 | SC_TRY_MSG(policy.maxAttempts > 0, "HttpClientSession: retry policy has no attempts"); |
| 1034 | |
| 1035 | state.method = request.method; |
| 1036 | state.policy = policy; |
| 1037 | state.attemptsStarted = 1; |
| 1038 | state.requestBodyReplayable = canReplayRequestBody(request.body); |
| 1039 | return Result(true); |
| 1040 | } |
| 1041 | |
| 1042 | bool SC::HttpClientSession::shouldRetry(HttpClientSessionRetryState& state, Result transportResult, |
| 1043 | const HttpClientResponse* response) const |