Commit f4658e29 authored by jan.koester's avatar jan.koester
Browse files

test

parent 450701d8
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -299,7 +299,9 @@ static bool handleDeployFallback(libhttppp::HttpRequest &curreq, const int tid,
}

blogi::Blogi::Blogi(std::vector<netplus::socket *> serversocket, bool debug)
    : HttpEvent(serversocket, 1000, static_cast<size_t>(std::thread::hardware_concurrency()), Blogi::Cfg->getidleconnectiontimeout()), _debug(debug)
    : HttpEvent(serversocket, 1000, static_cast<size_t>(std::thread::hardware_concurrency()),
                Blogi::Cfg->getidleconnectiontimeout(),
                static_cast<size_t>(std::thread::hardware_concurrency())), _debug(debug)
{
    Blogi::ActiveInstance = this;

@@ -686,6 +688,15 @@ bool blogi::Blogi::shouldOffloadH2Dispatch(libhttppp::HttpRequest &tempreq, uint
    return url.compare(0, prefix.length(), prefix) == 0;
}

bool blogi::Blogi::shouldOffloadH1Dispatch(libhttppp::HttpRequest &cureq) const {
    // Same route, same rationale as shouldOffloadH2Dispatch above.
    DomainContext *ctx = const_cast<Blogi*>(this)->resolveDomain(cureq);
    if (!ctx) return false;
    const std::string prefix = ctx->buildurl("media/getimage/");
    const std::string &url = cureq.getRequestURL();
    return url.compare(0, prefix.length(), prefix) == 0;
}

void blogi::Blogi::api(libhttppp::HttpRequest &curreq, const int tid, DomainContext &ctx)
{
    auto &PlgArgs = ctx.plgArgs;
+6 −0
Original line number Diff line number Diff line
@@ -80,6 +80,12 @@ namespace blogi {
        // local DB reads) on the original synchronous dispatch path.
        bool shouldOffloadH2Dispatch(libhttppp::HttpRequest &tempreq, uint32_t streamId) const override;

        // H1 analogue of the above: proxyplus speaks plain HTTP/1.1 to blogi hop-by-hop, so
        // without this the H2 override alone never fires for any request that actually comes
        // through the proxy (browsers get H2 only end-to-end without a proxy in front). Same
        // route, same rationale -- getimage's mediadb round-trip is the only slow path here.
        bool shouldOffloadH1Dispatch(libhttppp::HttpRequest &cureq) const override;

        DomainContext *resolveDomain(libhttppp::HttpRequest &curreq);

        // Reload SSL certificates at runtime (called after cert renewal)