Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wsd: wopiAccessCheck, remove unused CheckStatus, hook NotHttpSuccess #10810

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading