7 #ifndef _HTTP_SETTINGS_H_ 8 #define _HTTP_SETTINGS_H_ 10 #include <QHostAddress> 15 int qHash(
const QSslError error);
58 HttpSettings(
const QSettings *,
const QString& section, QObject *parent);
60 const QHostAddress&
address()
const {
return m_address; }
61 void setAddress(
const QHostAddress& x) { m_address = x; }
64 int port()
const {
return m_port; }
72 int maxAge()
const {
return m_maxAge; }
76 const QString&
encoding()
const {
return m_encoding; }
80 const QString&
docroot()
const {
return m_docroot; }
84 const QString&
indexFile()
const {
return m_indexFile; }
104 const QString&
tempDir()
const {
return m_tempDir; }
116 bool gzip()
const {
return m_gzip; }
120 const QString&
sslKey()
const {
return m_sslKey; }
124 const QString&
sslCrt()
const {
return m_sslCrt; }
128 const QString&
sslCaCrt()
const {
return m_sslCaCrt; }
158 void readSettings(
const QSettings* settings,
const QString& section,
const QString& section2);
164 void readSettings(
const QSettings* settings,
const QString& section);
171 void setSection2(
const QString& section) { m_section2 = section; }
174 #ifndef DOXYGEN_SHOULD_SKIP_THIS 177 QHostAddress m_address;
183 QString m_sessionCookieName;
184 int m_sessionExpirationTime;
185 int m_maxRequestSize;
186 int m_maxMultiPartSize;
192 QSet<QSslError> m_sslErrors;
193 bool m_ignoreAllSslErrors;
198 QString m_default_section2;
200 QHostAddress m_default_address;
201 int m_default_timeout;
202 int m_default_maxAge;
203 QString m_default_encoding;
204 QString m_default_docroot;
205 QString m_default_indexFile;
206 QString m_default_sessionCookieName;
207 int m_default_sessionExpirationTime;
208 int m_default_maxRequestSize;
209 int m_default_maxMultiPartSize;
210 QString m_default_tempDir;
211 bool m_default_useSSL;
212 QString m_default_sslKey;
213 QString m_default_sslCrt;
214 QString m_default_sslCaCrt;
215 bool m_default_ignoreAllSslErrors;
216 bool m_default_threads;
221 void setDefaultValues();
void readSettings(const QSettings *settings, const QString §ion, const QString §ion2)
Read settings from configuration file.
void setDefaultMaxAge(int x)
Sets the default max age cacheing proxy objects.
bool ignoreSslError(QSslError error) const
Returns true if the error should be ignored, default true.
void setMaxAge(int x)
Sets the max age cacheing proxy objects.
void setDefaultMaxMultiPartSize(int x)
Sets default maximum request size in multipart requests.
void setDefaultSessionCookieName(const QString &x)
Sets session cookie name.
int maxMultiPartSize() const
Returns maximum request size in multipart requests.
void setDefaultGzip(bool x)
Set default value for gzip compression.
const QString & encoding() const
Returns the encoding in COntent-type header.
const QString & sessionCookieName() const
Returns session cookie name.
void setThreads(bool x)
Set starting new thread for each connection.
void setDefaultSslCrt(const QString &x)
Set default SSL certificate.
void setDefaultPort(int x)
Sets the default port number.
void setDocroot(const QString &x)
Sets path to document root.
void setDefaultSslKey(const QString &x)
Set default SSL key.
void setDefaultMaxRequestSize(int x)
Sets default maximum request size.
void setDefaultTimeout(int x)
Sets default timeout for opened connection from clients.
const QString & sslCaCrt() const
Returns SSL CA certificate.
void setUseSSL(bool x)
Set status of SSL connections.
void setSslCaCrt(const QString &x)
Set SSL CA certificate.
bool threads() const
Returns true if server starts new thread for each connection.
const QString & tempDir() const
Returns path to temporary directory.
void setPort(int x)
Sets the port number.
void setSessionCookieName(const QString &x)
Sets default session cookie name.
HttpSettings(QObject *parent)
Constructor reads default QSettings file section [httpd].
void setIndexFile(const QString &x)
Sets name of index file in directory (index.html)
void setDefaultTempDir(const QString &x)
Sets default path to temporary directory.
int timeout() const
Returns timeout for opened connection from clients.
void setDefaultThreads(bool x)
Set default value for starting new thread for each connection.
void setEncoding(const QString &x)
Sets the encoding in COntent-type header.
void setSection2(const QString §ion)
Sets the name for the second section.
void setDefaultIndexFile(const QString &x)
Sets default name of index file in directory (index.html)
int maxAge() const
Returns the max age for cacheing proxy objects.
void setDefaultAddress(const QHostAddress &x)
Sets the defailt bind address.
Configuration of the http server instance.
const QString & sslKey() const
Returns SSL key.
const QHostAddress & address() const
Returns the bind address.
void setMaxMultiPartSize(int x)
Sets maximum request size in multipart requests.
bool useSSL() const
Returns status of SSL connections.
void setDefaultUseSSL(bool x)
Set default status of SSL connections.
int sessionExpirationTime() const
Returns maximum expiration time for the session.
const QString & indexFile() const
Returns name of index file in directory (index.html)
void setDefaultEncoding(const QString &x)
Sets the default encoding in COntent-type header.
int maxRequestSize() const
Returns maximum request size.
void setMaxRequestSize(int x)
Sets maximum request size.
void setTempDir(const QString &x)
Sets path to temporary directory.
void setTimeout(int x)
Sets timeout for opened connection from clients.
void setDefaultSslCaCrt(const QString &x)
Set default SSL CA certificate.
void setSslCrt(const QString &x)
Set SSL certificate.
void setDefaultDocroot(const QString &x)
Sets default path to document root.
const QString & sslCrt() const
Returns SSL certificate.
void setSslKey(const QString &x)
Set SSL key.
void setExpirationTime(int x)
Sets maximum expiration time for the session.
int port() const
Returns the port number.
void setAddress(const QHostAddress &x)
Sets the bind address.
void setDefaultExpirationTime(int x)
Sets default maximum expiration time for the session.
Namespace of HTTP server.
const QString & docroot() const
Returns path to document root.
bool gzip() const
Returns true if server can use gzip compression.
void setGzip(bool x)
Enable gzip compression.