DABC (Data Acquisition Backbone Core)  2.9.9
Civetweb.h
Go to the documentation of this file.
1 // $Id: Civetweb.h 4781 2021-07-14 12:28:15Z linev $
2 
3 /************************************************************
4  * The Data Acquisition Backbone Core (DABC) *
5  ************************************************************
6  * Copyright (C) 2009 - *
7  * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
8  * Planckstr. 1, 64291 Darmstadt, Germany *
9  * Contact: http://dabc.gsi.de *
10  ************************************************************
11  * This software can be used under the GPL license *
12  * agreements as stated in LICENSE.txt file *
13  * which is part of the distribution. *
14  ************************************************************/
15 
16 #ifndef HTTP_Civetweb
17 #define HTTP_Civetweb
18 
19 #ifndef HTTP_Server
20 #include "http/Server.h"
21 #endif
22 
23 #include "../civetweb/civetweb.h"
24 
25 namespace http {
26 
31  class Civetweb : public Server {
32  protected:
33  std::string fHttpPort;
34  std::string fHttpsPort;
36  std::string fAuthFile;
37  std::string fAuthDomain;
38  std::string fSslCertif;
39 
40  struct mg_context * fCtx;
41  struct mg_callbacks fCallbacks;
42 
43  virtual void OnThreadAssigned();
44 
45  public:
46  Civetweb(const std::string &name, dabc::Command cmd = nullptr);
47  virtual ~Civetweb();
48 
49  virtual const char* ClassName() const { return "HttpServer"; }
50 
51  static int begin_request_handler(struct mg_connection *conn, void*);
52 
53  static int log_message_handler(const struct mg_connection *conn, const char *message);
54  };
55 }
56 
57 #endif
Represents command with its arguments.
Definition: Command.h:99
Server provides http access to DABC
Definition: Civetweb.h:31
Civetweb(const std::string &name, dabc::Command cmd=nullptr)
Definition: Civetweb.cxx:20
struct mg_context * fCtx
Definition: Civetweb.h:40
virtual const char * ClassName() const
Returns class name of the object instance.
Definition: Civetweb.h:49
virtual void OnThreadAssigned()
Definition: Civetweb.cxx:55
static int log_message_handler(const struct mg_connection *conn, const char *message)
Definition: Civetweb.cxx:103
std::string fSslCertif
SSL certificate file name in plm format.
Definition: Civetweb.h:38
virtual ~Civetweb()
Definition: Civetweb.cxx:46
std::string fAuthFile
authentication file, generated by htdigest utility
Definition: Civetweb.h:36
int fNumThreads
number of civetweb threads
Definition: Civetweb.h:35
static int begin_request_handler(struct mg_connection *conn, void *)
Definition: Civetweb.cxx:114
struct mg_callbacks fCallbacks
Definition: Civetweb.h:41
std::string fHttpPort
port number for HTTP server
Definition: Civetweb.h:33
std::string fAuthDomain
realm parameter in authentication, "dabc@server" is default
Definition: Civetweb.h:37
std::string fHttpsPort
port number for HTTPS server
Definition: Civetweb.h:34
Server provides http access to DABC
Definition: Server.h:31
Support of HTTP in DABC.
Definition: Civetweb.h:25