Skip to content
Snippets Groups Projects
Commit 9ec51681 authored by Sergey Linev's avatar Sergey Linev Committed by Axel Naumann
Browse files

http: provide special hold handler

This is special requests, which does not processed immediately but hold
for the long time by the receiver. 

For the moment used in RWebWindow to hold headless browser until
processing is done
parent f6bb18eb
Branches
Tags
No related merge requests found
......@@ -62,6 +62,8 @@ protected:
virtual void ProcessRequest(std::shared_ptr<THttpCallArg> arg);
virtual void ProcessBatchHolder(std::shared_ptr<THttpCallArg> arg);
virtual void ProcessRequest(THttpCallArg *arg);
void StopServerThread();
......
......@@ -52,6 +52,9 @@ protected:
/// Method called when multi-threaded send operation is completed
virtual void CompleteWSSend(UInt_t) {}
/// Method used to accept or reject root_batch_holder.js request
virtual Bool_t ProcessBatchHolder(std::shared_ptr<THttpCallArg>) { return kFALSE; }
public:
virtual ~THttpWSHandler();
......
......@@ -717,6 +717,11 @@ Int_t THttpServer::ProcessRequests()
if (!arg)
break;
if (arg->fFileName == "root_batch_holder.js") {
ProcessBatchHolder(arg);
continue;
}
fSniffer->SetCurrentCallArg(arg.get());
try {
......@@ -779,6 +784,21 @@ void THttpServer::MissedRequest(THttpCallArg *arg)
arg->Set404();
}
////////////////////////////////////////////////////////////////////////////////
/// Process special http request for root_batch_holder.js script
/// This kind of requests used to hold web browser running in headless mode
/// Intentionally requests does not replied immediately
void THttpServer::ProcessBatchHolder(std::shared_ptr<THttpCallArg> arg)
{
auto wsptr = FindWS(arg->GetPathName());
if (!wsptr || !wsptr->ProcessBatchHolder(arg)) {
arg->Set404();
arg->NotifyCondition();
}
}
////////////////////////////////////////////////////////////////////////////////
/// Process single http request
/// Depending from requested path and filename different actions will be performed.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment