comparison OrthancServer/main.cpp @ 3137:5a3b961e9524

New configuration option: 'TcpNoDelay' to disable Nagle's algorithm in HTTP server
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 17 Jan 2019 18:24:23 +0100
parents 2b81d44e7b33
children ab46e537f92e
comparison
equal deleted inserted replaced
3136:f948deef53d9 3137:5a3b961e9524
798 { 798 {
799 MyIncomingHttpRequestFilter httpFilter(context, plugins); 799 MyIncomingHttpRequestFilter httpFilter(context, plugins);
800 MongooseServer httpServer; 800 MongooseServer httpServer;
801 bool httpDescribeErrors; 801 bool httpDescribeErrors;
802 802
803 #if ORTHANC_ENABLE_MONGOOSE == 1
804 const bool defaultKeepAlive = false;
805 #elif ORTHANC_ENABLE_CIVETWEB == 1
806 const bool defaultKeepAlive = true;
807 #else
808 # error "Either Mongoose or Civetweb must be enabled to compile this file"
809 #endif
810
803 { 811 {
804 OrthancConfiguration::ReaderLock lock; 812 OrthancConfiguration::ReaderLock lock;
805 813
806 httpDescribeErrors = lock.GetConfiguration().GetBooleanParameter("HttpDescribeErrors", true); 814 httpDescribeErrors = lock.GetConfiguration().GetBooleanParameter("HttpDescribeErrors", true);
807 815
808 // HTTP server 816 // HTTP server
809 //httpServer.SetThreadsCount(50); 817 //httpServer.SetThreadsCount(50);
810 httpServer.SetPortNumber(lock.GetConfiguration().GetUnsignedIntegerParameter("HttpPort", 8042)); 818 httpServer.SetPortNumber(lock.GetConfiguration().GetUnsignedIntegerParameter("HttpPort", 8042));
811 httpServer.SetRemoteAccessAllowed(lock.GetConfiguration().GetBooleanParameter("RemoteAccessAllowed", false)); 819 httpServer.SetRemoteAccessAllowed(lock.GetConfiguration().GetBooleanParameter("RemoteAccessAllowed", false));
812 httpServer.SetKeepAliveEnabled(lock.GetConfiguration().GetBooleanParameter("KeepAlive", true)); 820 httpServer.SetKeepAliveEnabled(lock.GetConfiguration().GetBooleanParameter("KeepAlive", defaultKeepAlive));
813 httpServer.SetHttpCompressionEnabled(lock.GetConfiguration().GetBooleanParameter("HttpCompressionEnabled", true)); 821 httpServer.SetHttpCompressionEnabled(lock.GetConfiguration().GetBooleanParameter("HttpCompressionEnabled", true));
814 httpServer.SetAuthenticationEnabled(lock.GetConfiguration().GetBooleanParameter("AuthenticationEnabled", false)); 822 httpServer.SetAuthenticationEnabled(lock.GetConfiguration().GetBooleanParameter("AuthenticationEnabled", false));
823 httpServer.SetTcpNoDelay(lock.GetConfiguration().GetBooleanParameter("TcpNoDelay", true));
815 824
816 lock.GetConfiguration().SetupRegisteredUsers(httpServer); 825 lock.GetConfiguration().SetupRegisteredUsers(httpServer);
817 826
818 if (lock.GetConfiguration().GetBooleanParameter("SslEnabled", false)) 827 if (lock.GetConfiguration().GetBooleanParameter("SslEnabled", false))
819 { 828 {