comparison Core/HttpServer/HttpServer.cpp @ 3178:6d558598d713

Fix build with unpatched versions of Civetweb (missing "mg_disable_keep_alive()")
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Jan 2019 12:41:20 +0100
parents 6e8822be2f08
children 07a2f637b76d
comparison
equal deleted inserted replaced
3177:053e72ff9fc5 3178:6d558598d713
45 # include <mongoose.h> 45 # include <mongoose.h>
46 46
47 #elif ORTHANC_ENABLE_CIVETWEB == 1 47 #elif ORTHANC_ENABLE_CIVETWEB == 1
48 # include <civetweb.h> 48 # include <civetweb.h>
49 # define MONGOOSE_USE_CALLBACKS 1 49 # define MONGOOSE_USE_CALLBACKS 1
50 # if !defined(CIVETWEB_HAS_DISABLE_KEEP_ALIVE)
51 # error Macro CIVETWEB_HAS_DISABLE_KEEP_ALIVE must be defined
52 # endif
50 53
51 #else 54 #else
52 # error "Either Mongoose or Civetweb must be enabled to compile this file" 55 # error "Either Mongoose or Civetweb must be enabled to compile this file"
53 #endif 56 #endif
54 57
112 virtual void DisableKeepAlive() 115 virtual void DisableKeepAlive()
113 { 116 {
114 #if ORTHANC_ENABLE_MONGOOSE == 1 117 #if ORTHANC_ENABLE_MONGOOSE == 1
115 throw OrthancException(ErrorCode_NotImplemented, 118 throw OrthancException(ErrorCode_NotImplemented,
116 "Only available if using CivetWeb"); 119 "Only available if using CivetWeb");
120
117 #elif ORTHANC_ENABLE_CIVETWEB == 1 121 #elif ORTHANC_ENABLE_CIVETWEB == 1
122 # if CIVETWEB_HAS_DISABLE_KEEP_ALIVE == 1
118 mg_disable_keep_alive(connection_); 123 mg_disable_keep_alive(connection_);
124 # else
125 # warning The function "mg_disable_keep_alive()" is not available, DICOMweb might run slowly
126 throw OrthancException(ErrorCode_NotImplemented,
127 "Only available if using a patched version of CivetWeb");
128 # endif
129
130 #else
131 # error Please support your embedded Web server here
119 #endif 132 #endif
120 } 133 }
121 }; 134 };
122 135
123 136