Skip to content

Commit

Permalink
wsd: wopiAccessCheck, remove unused CheckStatus, hook NotHttpSuccess
Browse files Browse the repository at this point in the history
Signed-off-by: Méven Car <[email protected]>
Change-Id: Ic022614625bfa3aa0a5b819fda1adcf50c7465d1
  • Loading branch information
meven committed Jan 2, 2025
1 parent c0c8909 commit 45ae2e2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions wsd/ClientRequestDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1108,10 +1108,8 @@ STATE_ENUM(CheckStatus,
NotHttpSuccess,
HostNotFound,
WopiHostNotAllowed,
HostUnReachable,
UnspecifiedError,
ConnectionAborted,
ConnectionRefused,
CertificateValidation,
SSLHandshakeFail,
MissingSsl,
Expand Down Expand Up @@ -1289,15 +1287,17 @@ bool ClientRequestDispatcher::handleWopiAccessCheckRequest(const Poco::Net::HTTP
{
LOG_TRC("finishHandler ");

CheckStatus status = CheckStatus::Ok;
const auto lastErrno = errno;

const auto httpResponse = probeSession->response();
const auto responseState = httpResponse->state();
const std::shared_ptr<http::Response> httpResponse = probeSession->response();
const http::Response::State responseState = httpResponse->state();
const http::StatusCode statusCode = httpResponse->statusCode();
LOG_DBG("Wopi Access Check: got response state: " << responseState << " "
<< ", response status code: " <<httpResponse->statusCode() << " "
<< ", response status code: " << statusCode << " "
<< ", last errno: " << lastErrno);

CheckStatus status = statusCode == http::StatusCode::OK ? CheckStatus::Ok: CheckStatus::NotHttpSuccess;

if (responseState != http::Response::State::Complete)
{
// are TLS errors here ?
Expand Down

0 comments on commit 45ae2e2

Please sign in to comment.