Logo ROOT   6.18/05
Reference Guide
TCivetweb.h
Go to the documentation of this file.
1// $Id$
2// Author: Sergey Linev 21/12/2013
3
4/*************************************************************************
5 * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TCivetweb
13#define ROOT_TCivetweb
14
15#include "THttpEngine.h"
16#include "TString.h"
17
18class TCivetweb : public THttpEngine {
19protected:
20 void *fCtx{nullptr}; ///<! civetweb context
21 void *fCallbacks{nullptr}; ///<! call-back table for civetweb webserver
22 TString fTopName; ///<! name of top item
23 Bool_t fDebug{kFALSE}; ///<! debug mode
24 Bool_t fTerminating{kFALSE}; ///<! server doing shutdown and not react on requests
25 Bool_t fOnlySecured{kFALSE}; ///<! if server should run only https protocol
26 Int_t fMaxAge{3600}; ///<! max-age parameter
27
28 virtual void Terminate() { fTerminating = kTRUE; }
29
30 Bool_t IsSecured() const { return fOnlySecured; }
31
32public:
33 TCivetweb(Bool_t only_secured = kFALSE);
34 virtual ~TCivetweb();
35
36 virtual Bool_t Create(const char *args);
37
38 const char *GetTopName() const { return fTopName.Data(); }
39
40 Bool_t IsDebugMode() const { return fDebug; }
41
42 Bool_t IsTerminating() const { return fTerminating; }
43
44 Int_t ProcessLog(const char *message);
45
46 Int_t GetMaxAge() const { return fMaxAge; }
47};
48
49#endif
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
virtual void Terminate()
Method called when server want to be terminated.
Definition: TCivetweb.h:28
Bool_t IsTerminating() const
Definition: TCivetweb.h:42
Int_t GetMaxAge() const
Definition: TCivetweb.h:46
const char * GetTopName() const
Definition: TCivetweb.h:38
void * fCtx
! civetweb context
Definition: TCivetweb.h:20
TCivetweb(Bool_t only_secured=kFALSE)
constructor
Definition: TCivetweb.cxx:416
Int_t fMaxAge
! max-age parameter
Definition: TCivetweb.h:26
Int_t ProcessLog(const char *message)
process civetweb log message, can be used to detect critical errors
Definition: TCivetweb.cxx:436
TString fTopName
! name of top item
Definition: TCivetweb.h:22
Bool_t fOnlySecured
! if server should run only https protocol
Definition: TCivetweb.h:25
Bool_t fTerminating
! server doing shutdown and not react on requests
Definition: TCivetweb.h:24
Bool_t IsSecured() const
Definition: TCivetweb.h:30
Bool_t IsDebugMode() const
Definition: TCivetweb.h:40
virtual ~TCivetweb()
destructor
Definition: TCivetweb.cxx:425
Bool_t fDebug
! debug mode
Definition: TCivetweb.h:23
void * fCallbacks
! call-back table for civetweb webserver
Definition: TCivetweb.h:21
virtual Bool_t Create(const char *args)
Creates embedded civetweb server As main argument, http port should be specified like "8090".
Definition: TCivetweb.cxx:466
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364