passenger 3.0.7 → 3.0.8
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- data/NEWS +27 -0
- data/README +1 -1
- data/bin/passenger-install-nginx-module +3 -1
- data/build/config.rb +2 -1
- data/build/cxx_tests.rb +7 -3
- data/build/documentation.rb +5 -40
- data/build/nginx.rb +0 -1
- data/build/packaging.rb +0 -6
- data/build/rake_extensions.rb +5 -0
- data/doc/Architectural overview.html +344 -77
- data/doc/Security of user switching support.html +338 -71
- data/doc/Users guide Apache with comments.html +4830 -0
- data/doc/Users guide Apache.html +695 -428
- data/doc/Users guide Apache.idmap.txt +80 -0
- data/doc/Users guide Apache.txt +5 -5
- data/doc/Users guide Nginx.html +591 -313
- data/doc/Users guide Nginx.txt +9 -3
- data/doc/Users guide Standalone.html +344 -77
- data/ext/boost/src/pthread/thread.cpp +1 -1
- data/ext/common/AccountsDatabase.h +1 -1
- data/ext/common/Constants.h +2 -2
- data/ext/common/Logging.h +2 -1
- data/ext/common/LoggingAgent/FilterSupport.h +107 -3
- data/ext/common/Session.h +1 -1
- data/ext/common/Utils.cpp +2 -0
- data/ext/common/Utils/Dechunker.h +232 -0
- data/ext/common/Utils/HttpHeaderBufferer.h +165 -0
- data/ext/common/Utils/StrIntUtils.cpp +51 -15
- data/ext/common/Utils/StrIntUtils.h +3 -0
- data/ext/common/Utils/StreamBoyerMooreHorspool.h +506 -0
- data/ext/nginx/Configuration.c +36 -282
- data/ext/nginx/ContentHandler.c +17 -0
- data/ext/nginx/HelperAgent.cpp +397 -39
- data/ext/oxt/tracable_exception.cpp +3 -1
- data/ext/ruby/extconf.rb +1 -0
- data/ext/ruby/passenger_native_support.c +3 -0
- data/helper-scripts/prespawn +113 -31
- data/lib/phusion_passenger.rb +2 -2
- data/lib/phusion_passenger/standalone/runtime_installer.rb +3 -2
- data/lib/phusion_passenger/standalone/start_command.rb +12 -12
- data/test/cxx/DechunkerTest.cpp +216 -0
- data/test/cxx/FilterSupportTest.cpp +31 -4
- data/test/cxx/HttpHeaderBuffererTest.cpp +203 -0
- data/test/cxx/UtilsTest.cpp +46 -3
- data/test/integration_tests/hello_world_rack_spec.rb +7 -0
- data/test/stub/rack/config.ru +6 -1
- data/test/stub/rails_apps/1.2/empty/public/dispatch.cgi +1 -1
- data/test/stub/rails_apps/1.2/empty/public/dispatch.fcgi +1 -1
- data/test/stub/rails_apps/1.2/empty/public/dispatch.rb +1 -1
- data/test/stub/rails_apps/2.0/empty/public/dispatch.cgi +1 -1
- data/test/stub/rails_apps/2.0/empty/public/dispatch.fcgi +1 -1
- data/test/stub/rails_apps/2.0/empty/public/dispatch.rb +1 -1
- data/test/stub/rails_apps/2.2/empty/public/dispatch.cgi +1 -1
- data/test/stub/rails_apps/2.2/empty/public/dispatch.fcgi +1 -1
- data/test/stub/rails_apps/2.2/empty/public/dispatch.rb +1 -1
- metadata +20 -403
- data/doc/Doxyfile +0 -241
- data/doc/cxxapi/AbstractSpawnManager_8h_source.html +0 -141
- data/doc/cxxapi/Account_8h_source.html +0 -206
- data/doc/cxxapi/AccountsDatabase_8h_source.html +0 -161
- data/doc/cxxapi/AgentBase_8h_source.html +0 -70
- data/doc/cxxapi/AgentsStarter_8h_source.html +0 -112
- data/doc/cxxapi/BCrypt_8h_source.html +0 -104
- data/doc/cxxapi/Blowfish_8h_source.html +0 -134
- data/doc/cxxapi/Bucket_8h_source.html +0 -118
- data/doc/cxxapi/Constants_8h_source.html +0 -79
- data/doc/cxxapi/ContentHandler_8h_source.html +0 -95
- data/doc/cxxapi/DirectoryMapper_8h_source.html +0 -311
- data/doc/cxxapi/EventedClient_8h_source.html +0 -733
- data/doc/cxxapi/EventedMessageServer_8h_source.html +0 -358
- data/doc/cxxapi/EventedServer_8h_source.html +0 -326
- data/doc/cxxapi/Exceptions_8h_source.html +0 -393
- data/doc/cxxapi/FileDescriptor_8h_source.html +0 -324
- data/doc/cxxapi/Hooks_8h_source.html +0 -76
- data/doc/cxxapi/HttpStatusExtractor_8h_source.html +0 -382
- data/doc/cxxapi/IniFile_8h_source.html +0 -527
- data/doc/cxxapi/Logging_8h_source.html +0 -796
- data/doc/cxxapi/MessageChannel_8h_source.html +0 -776
- data/doc/cxxapi/MessageClient_8h_source.html +0 -328
- data/doc/cxxapi/MessageReadersWriters_8h_source.html +0 -539
- data/doc/cxxapi/MessageServer_8h_source.html +0 -612
- data/doc/cxxapi/PoolOptions_8h_source.html +0 -549
- data/doc/cxxapi/Process_8h_source.html +0 -286
- data/doc/cxxapi/RandomGenerator_8h_source.html +0 -191
- data/doc/cxxapi/ResourceLocator_8h_source.html +0 -166
- data/doc/cxxapi/SafeLibev_8h_source.html +0 -180
- data/doc/cxxapi/ScgiRequestParser_8h_source.html +0 -406
- data/doc/cxxapi/ServerInstanceDir_8h_source.html +0 -378
- data/doc/cxxapi/Session_8h_source.html +0 -501
- data/doc/cxxapi/SpawnManager_8h_source.html +0 -647
- data/doc/cxxapi/StaticContentHandler_8h_source.html +0 -69
- data/doc/cxxapi/StaticString_8h_source.html +0 -329
- data/doc/cxxapi/StringListCreator_8h_source.html +0 -114
- data/doc/cxxapi/Utils_8h_source.html +0 -469
- data/doc/cxxapi/annotated.html +0 -87
- data/doc/cxxapi/apache2_2Configuration_8h_source.html +0 -82
- data/doc/cxxapi/classAgentWatcher-members.html +0 -54
- data/doc/cxxapi/classAgentWatcher.html +0 -419
- data/doc/cxxapi/classClient-members.html +0 -38
- data/doc/cxxapi/classClient.html +0 -123
- data/doc/cxxapi/classHooks-members.html +0 -40
- data/doc/cxxapi/classHooks.html +0 -153
- data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager-members.html +0 -40
- data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager.html +0 -187
- data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1ArgumentException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1ArgumentException.html +0 -56
- data/doc/cxxapi/classPassenger_1_1ArrayMessage-members.html +0 -37
- data/doc/cxxapi/classPassenger_1_1ArrayMessage.html +0 -113
- data/doc/cxxapi/classPassenger_1_1BufferedUpload-members.html +0 -38
- data/doc/cxxapi/classPassenger_1_1BufferedUpload.html +0 -112
- data/doc/cxxapi/classPassenger_1_1BusyException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1BusyException.html +0 -54
- data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +0 -51
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +0 -41
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +0 -223
- data/doc/cxxapi/classPassenger_1_1EOFException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1EOFException.html +0 -61
- data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1EventFd-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1EventFd.html +0 -52
- data/doc/cxxapi/classPassenger_1_1EventedClient-members.html +0 -59
- data/doc/cxxapi/classPassenger_1_1EventedClient.html +0 -531
- data/doc/cxxapi/classPassenger_1_1EventedMessageServer-members.html +0 -37
- data/doc/cxxapi/classPassenger_1_1EventedMessageServer.html +0 -59
- data/doc/cxxapi/classPassenger_1_1EventedMessageServer__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1EventedMessageServer__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1EventedMessageServer__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1EventedServer-members.html +0 -37
- data/doc/cxxapi/classPassenger_1_1EventedServer.html +0 -93
- data/doc/cxxapi/classPassenger_1_1EventedServer__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1EventedServer__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1EventedServer__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1FileDescriptor-members.html +0 -41
- data/doc/cxxapi/classPassenger_1_1FileDescriptor.html +0 -178
- data/doc/cxxapi/classPassenger_1_1FileDescriptorPair-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1FileDescriptorPair.html +0 -52
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +0 -58
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +0 -41
- data/doc/cxxapi/classPassenger_1_1FileSystemException.html +0 -66
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1HttpStatusExtractor-members.html +0 -39
- data/doc/cxxapi/classPassenger_1_1HttpStatusExtractor.html +0 -128
- data/doc/cxxapi/classPassenger_1_1IOException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1IOException.html +0 -61
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.map +0 -4
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +0 -57
- data/doc/cxxapi/classPassenger_1_1MessageChannel.html +0 -839
- data/doc/cxxapi/classPassenger_1_1MessageServer-members.html +0 -49
- data/doc/cxxapi/classPassenger_1_1MessageServer.html +0 -407
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext.html +0 -58
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext-members.html +0 -41
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext.html +0 -165
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler-members.html +0 -39
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler.html +0 -173
- data/doc/cxxapi/classPassenger_1_1Process-members.html +0 -44
- data/doc/cxxapi/classPassenger_1_1Process.html +0 -290
- data/doc/cxxapi/classPassenger_1_1RandomGenerator-members.html +0 -37
- data/doc/cxxapi/classPassenger_1_1RandomGenerator.html +0 -79
- data/doc/cxxapi/classPassenger_1_1ResourceLocator-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1ResourceLocator.html +0 -51
- data/doc/cxxapi/classPassenger_1_1RuntimeException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1RuntimeException.html +0 -54
- data/doc/cxxapi/classPassenger_1_1SafeLibev-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1SafeLibev.html +0 -51
- data/doc/cxxapi/classPassenger_1_1ScalarMessage-members.html +0 -37
- data/doc/cxxapi/classPassenger_1_1ScalarMessage.html +0 -76
- data/doc/cxxapi/classPassenger_1_1ScgiRequestParser-members.html +0 -50
- data/doc/cxxapi/classPassenger_1_1ScgiRequestParser.html +0 -285
- data/doc/cxxapi/classPassenger_1_1SecurityException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1SecurityException.html +0 -56
- data/doc/cxxapi/classPassenger_1_1Session-members.html +0 -53
- data/doc/cxxapi/classPassenger_1_1Session.html +0 -556
- data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +0 -39
- data/doc/cxxapi/classPassenger_1_1SpawnException.html +0 -101
- data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +0 -42
- data/doc/cxxapi/classPassenger_1_1SpawnManager.html +0 -292
- data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1StandardSession-members.html +0 -54
- data/doc/cxxapi/classPassenger_1_1StandardSession.html +0 -394
- data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1StaticString-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1StaticString.html +0 -56
- data/doc/cxxapi/classPassenger_1_1SyntaxError-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1SyntaxError.html +0 -54
- data/doc/cxxapi/classPassenger_1_1SystemException-members.html +0 -40
- data/doc/cxxapi/classPassenger_1_1SystemException.html +0 -155
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.map +0 -4
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1TimeRetrievalException-members.html +0 -40
- data/doc/cxxapi/classPassenger_1_1TimeRetrievalException.html +0 -61
- data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1TimeoutException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1TimeoutException.html +0 -54
- data/doc/cxxapi/classPassenger_1_1Uint16Message-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1Uint16Message.html +0 -51
- data/doc/cxxapi/classPassenger_1_1Uint32Message-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1Uint32Message.html +0 -51
- data/doc/cxxapi/classServer-members.html +0 -36
- data/doc/cxxapi/classServer.html +0 -49
- data/doc/cxxapi/classServerInstanceDirToucher-members.html +0 -36
- data/doc/cxxapi/classServerInstanceDirToucher.html +0 -47
- data/doc/cxxapi/classes.html +0 -52
- data/doc/cxxapi/definitions_8h_source.html +0 -36
- data/doc/cxxapi/doxygen.css +0 -532
- data/doc/cxxapi/doxygen.png +0 -0
- data/doc/cxxapi/files.html +0 -76
- data/doc/cxxapi/ftv2blank.png +0 -0
- data/doc/cxxapi/ftv2doc.png +0 -0
- data/doc/cxxapi/ftv2folderclosed.png +0 -0
- data/doc/cxxapi/ftv2folderopen.png +0 -0
- data/doc/cxxapi/ftv2lastnode.png +0 -0
- data/doc/cxxapi/ftv2link.png +0 -0
- data/doc/cxxapi/ftv2mlastnode.png +0 -0
- data/doc/cxxapi/ftv2mnode.png +0 -0
- data/doc/cxxapi/ftv2node.png +0 -0
- data/doc/cxxapi/ftv2plastnode.png +0 -0
- data/doc/cxxapi/ftv2pnode.png +0 -0
- data/doc/cxxapi/ftv2vertline.png +0 -0
- data/doc/cxxapi/functions.html +0 -103
- data/doc/cxxapi/functions_0x62.html +0 -82
- data/doc/cxxapi/functions_0x63.html +0 -102
- data/doc/cxxapi/functions_0x64.html +0 -102
- data/doc/cxxapi/functions_0x65.html +0 -88
- data/doc/cxxapi/functions_0x66.html +0 -100
- data/doc/cxxapi/functions_0x67.html +0 -167
- data/doc/cxxapi/functions_0x68.html +0 -88
- data/doc/cxxapi/functions_0x69.html +0 -96
- data/doc/cxxapi/functions_0x6b.html +0 -80
- data/doc/cxxapi/functions_0x6c.html +0 -88
- data/doc/cxxapi/functions_0x6d.html +0 -88
- data/doc/cxxapi/functions_0x6e.html +0 -86
- data/doc/cxxapi/functions_0x6f.html +0 -94
- data/doc/cxxapi/functions_0x70.html +0 -94
- data/doc/cxxapi/functions_0x72.html +0 -110
- data/doc/cxxapi/functions_0x73.html +0 -171
- data/doc/cxxapi/functions_0x74.html +0 -85
- data/doc/cxxapi/functions_0x75.html +0 -85
- data/doc/cxxapi/functions_0x77.html +0 -92
- data/doc/cxxapi/functions_0x7e.html +0 -79
- data/doc/cxxapi/functions_enum.html +0 -49
- data/doc/cxxapi/functions_eval.html +0 -67
- data/doc/cxxapi/functions_func.html +0 -531
- data/doc/cxxapi/functions_vars.html +0 -278
- data/doc/cxxapi/graph_legend.dot +0 -22
- data/doc/cxxapi/graph_legend.html +0 -92
- data/doc/cxxapi/graph_legend.png +0 -0
- data/doc/cxxapi/group__Core.html +0 -46
- data/doc/cxxapi/group__Core.map +0 -3
- data/doc/cxxapi/group__Core.png +0 -0
- data/doc/cxxapi/group__Exceptions.html +0 -53
- data/doc/cxxapi/group__Hooks.html +0 -42
- data/doc/cxxapi/group__Hooks.map +0 -3
- data/doc/cxxapi/group__Hooks.png +0 -0
- data/doc/cxxapi/group__Support.html +0 -538
- data/doc/cxxapi/hierarchy.html +0 -101
- data/doc/cxxapi/index.html +0 -16
- data/doc/cxxapi/inherit__graph__0.map +0 -3
- data/doc/cxxapi/inherit__graph__0.md5 +0 -1
- data/doc/cxxapi/inherit__graph__0.png +0 -0
- data/doc/cxxapi/inherit__graph__1.map +0 -3
- data/doc/cxxapi/inherit__graph__1.md5 +0 -1
- data/doc/cxxapi/inherit__graph__1.png +0 -0
- data/doc/cxxapi/inherit__graph__10.map +0 -3
- data/doc/cxxapi/inherit__graph__10.md5 +0 -1
- data/doc/cxxapi/inherit__graph__10.png +0 -0
- data/doc/cxxapi/inherit__graph__11.map +0 -4
- data/doc/cxxapi/inherit__graph__11.md5 +0 -1
- data/doc/cxxapi/inherit__graph__11.png +0 -0
- data/doc/cxxapi/inherit__graph__12.map +0 -3
- data/doc/cxxapi/inherit__graph__12.md5 +0 -1
- data/doc/cxxapi/inherit__graph__12.png +0 -0
- data/doc/cxxapi/inherit__graph__13.map +0 -3
- data/doc/cxxapi/inherit__graph__13.md5 +0 -1
- data/doc/cxxapi/inherit__graph__13.png +0 -0
- data/doc/cxxapi/inherit__graph__14.map +0 -3
- data/doc/cxxapi/inherit__graph__14.md5 +0 -1
- data/doc/cxxapi/inherit__graph__14.png +0 -0
- data/doc/cxxapi/inherit__graph__15.map +0 -3
- data/doc/cxxapi/inherit__graph__15.md5 +0 -1
- data/doc/cxxapi/inherit__graph__15.png +0 -0
- data/doc/cxxapi/inherit__graph__16.map +0 -5
- data/doc/cxxapi/inherit__graph__16.md5 +0 -1
- data/doc/cxxapi/inherit__graph__16.png +0 -0
- data/doc/cxxapi/inherit__graph__17.map +0 -3
- data/doc/cxxapi/inherit__graph__17.md5 +0 -1
- data/doc/cxxapi/inherit__graph__17.png +0 -0
- data/doc/cxxapi/inherit__graph__18.map +0 -3
- data/doc/cxxapi/inherit__graph__18.md5 +0 -1
- data/doc/cxxapi/inherit__graph__18.png +0 -0
- data/doc/cxxapi/inherit__graph__19.map +0 -4
- data/doc/cxxapi/inherit__graph__19.md5 +0 -1
- data/doc/cxxapi/inherit__graph__19.png +0 -0
- data/doc/cxxapi/inherit__graph__2.map +0 -3
- data/doc/cxxapi/inherit__graph__2.md5 +0 -1
- data/doc/cxxapi/inherit__graph__2.png +0 -0
- data/doc/cxxapi/inherit__graph__20.map +0 -3
- data/doc/cxxapi/inherit__graph__20.md5 +0 -1
- data/doc/cxxapi/inherit__graph__20.png +0 -0
- data/doc/cxxapi/inherit__graph__21.map +0 -3
- data/doc/cxxapi/inherit__graph__21.md5 +0 -1
- data/doc/cxxapi/inherit__graph__21.png +0 -0
- data/doc/cxxapi/inherit__graph__22.map +0 -3
- data/doc/cxxapi/inherit__graph__22.md5 +0 -1
- data/doc/cxxapi/inherit__graph__22.png +0 -0
- data/doc/cxxapi/inherit__graph__23.map +0 -3
- data/doc/cxxapi/inherit__graph__23.md5 +0 -1
- data/doc/cxxapi/inherit__graph__23.png +0 -0
- data/doc/cxxapi/inherit__graph__24.map +0 -3
- data/doc/cxxapi/inherit__graph__24.md5 +0 -1
- data/doc/cxxapi/inherit__graph__24.png +0 -0
- data/doc/cxxapi/inherit__graph__25.map +0 -3
- data/doc/cxxapi/inherit__graph__25.md5 +0 -1
- data/doc/cxxapi/inherit__graph__25.png +0 -0
- data/doc/cxxapi/inherit__graph__26.map +0 -3
- data/doc/cxxapi/inherit__graph__26.md5 +0 -1
- data/doc/cxxapi/inherit__graph__26.png +0 -0
- data/doc/cxxapi/inherit__graph__27.map +0 -3
- data/doc/cxxapi/inherit__graph__27.md5 +0 -1
- data/doc/cxxapi/inherit__graph__27.png +0 -0
- data/doc/cxxapi/inherit__graph__28.map +0 -3
- data/doc/cxxapi/inherit__graph__28.md5 +0 -1
- data/doc/cxxapi/inherit__graph__28.png +0 -0
- data/doc/cxxapi/inherit__graph__29.map +0 -3
- data/doc/cxxapi/inherit__graph__29.md5 +0 -1
- data/doc/cxxapi/inherit__graph__29.png +0 -0
- data/doc/cxxapi/inherit__graph__3.map +0 -4
- data/doc/cxxapi/inherit__graph__3.md5 +0 -1
- data/doc/cxxapi/inherit__graph__3.png +0 -0
- data/doc/cxxapi/inherit__graph__30.map +0 -3
- data/doc/cxxapi/inherit__graph__30.md5 +0 -1
- data/doc/cxxapi/inherit__graph__30.png +0 -0
- data/doc/cxxapi/inherit__graph__31.map +0 -4
- data/doc/cxxapi/inherit__graph__31.md5 +0 -1
- data/doc/cxxapi/inherit__graph__31.png +0 -0
- data/doc/cxxapi/inherit__graph__32.map +0 -3
- data/doc/cxxapi/inherit__graph__32.md5 +0 -1
- data/doc/cxxapi/inherit__graph__32.png +0 -0
- data/doc/cxxapi/inherit__graph__33.map +0 -3
- data/doc/cxxapi/inherit__graph__33.md5 +0 -1
- data/doc/cxxapi/inherit__graph__33.png +0 -0
- data/doc/cxxapi/inherit__graph__34.map +0 -3
- data/doc/cxxapi/inherit__graph__34.md5 +0 -1
- data/doc/cxxapi/inherit__graph__34.png +0 -0
- data/doc/cxxapi/inherit__graph__35.map +0 -3
- data/doc/cxxapi/inherit__graph__35.md5 +0 -1
- data/doc/cxxapi/inherit__graph__35.png +0 -0
- data/doc/cxxapi/inherit__graph__36.map +0 -5
- data/doc/cxxapi/inherit__graph__36.md5 +0 -1
- data/doc/cxxapi/inherit__graph__36.png +0 -0
- data/doc/cxxapi/inherit__graph__37.map +0 -3
- data/doc/cxxapi/inherit__graph__37.md5 +0 -1
- data/doc/cxxapi/inherit__graph__37.png +0 -0
- data/doc/cxxapi/inherit__graph__38.map +0 -3
- data/doc/cxxapi/inherit__graph__38.md5 +0 -1
- data/doc/cxxapi/inherit__graph__38.png +0 -0
- data/doc/cxxapi/inherit__graph__39.map +0 -3
- data/doc/cxxapi/inherit__graph__39.md5 +0 -1
- data/doc/cxxapi/inherit__graph__39.png +0 -0
- data/doc/cxxapi/inherit__graph__4.map +0 -3
- data/doc/cxxapi/inherit__graph__4.md5 +0 -1
- data/doc/cxxapi/inherit__graph__4.png +0 -0
- data/doc/cxxapi/inherit__graph__40.map +0 -3
- data/doc/cxxapi/inherit__graph__40.md5 +0 -1
- data/doc/cxxapi/inherit__graph__40.png +0 -0
- data/doc/cxxapi/inherit__graph__41.map +0 -3
- data/doc/cxxapi/inherit__graph__41.md5 +0 -1
- data/doc/cxxapi/inherit__graph__41.png +0 -0
- data/doc/cxxapi/inherit__graph__5.map +0 -3
- data/doc/cxxapi/inherit__graph__5.md5 +0 -1
- data/doc/cxxapi/inherit__graph__5.png +0 -0
- data/doc/cxxapi/inherit__graph__6.map +0 -3
- data/doc/cxxapi/inherit__graph__6.md5 +0 -1
- data/doc/cxxapi/inherit__graph__6.png +0 -0
- data/doc/cxxapi/inherit__graph__7.map +0 -3
- data/doc/cxxapi/inherit__graph__7.md5 +0 -1
- data/doc/cxxapi/inherit__graph__7.png +0 -0
- data/doc/cxxapi/inherit__graph__8.map +0 -3
- data/doc/cxxapi/inherit__graph__8.md5 +0 -1
- data/doc/cxxapi/inherit__graph__8.png +0 -0
- data/doc/cxxapi/inherit__graph__9.map +0 -3
- data/doc/cxxapi/inherit__graph__9.md5 +0 -1
- data/doc/cxxapi/inherit__graph__9.png +0 -0
- data/doc/cxxapi/inherits.html +0 -165
- data/doc/cxxapi/main.html +0 -28
- data/doc/cxxapi/modules.html +0 -36
- data/doc/cxxapi/namespacePassenger.html +0 -585
- data/doc/cxxapi/namespacemembers.html +0 -190
- data/doc/cxxapi/namespacemembers_enum.html +0 -48
- data/doc/cxxapi/namespacemembers_eval.html +0 -57
- data/doc/cxxapi/namespacemembers_func.html +0 -114
- data/doc/cxxapi/namespacemembers_type.html +0 -54
- data/doc/cxxapi/namespaces.html +0 -37
- data/doc/cxxapi/nginx_2Configuration_8h_source.html +0 -126
- data/doc/cxxapi/ngx__http__passenger__module_8h_source.html +0 -95
- data/doc/cxxapi/structPassenger_1_1MessageServer_1_1DisconnectEventBroadcastGuard-members.html +0 -36
- data/doc/cxxapi/structPassenger_1_1MessageServer_1_1DisconnectEventBroadcastGuard.html +0 -51
- data/doc/cxxapi/structPassenger_1_1PoolOptions-members.html +0 -67
- data/doc/cxxapi/structPassenger_1_1PoolOptions.html +0 -647
- data/doc/cxxapi/structPassenger_1_1StaticString_1_1Hash-members.html +0 -36
- data/doc/cxxapi/structPassenger_1_1StaticString_1_1Hash.html +0 -51
- data/doc/cxxapi/tab_b.gif +0 -0
- data/doc/cxxapi/tab_l.gif +0 -0
- data/doc/cxxapi/tab_r.gif +0 -0
- data/doc/cxxapi/tabs.css +0 -105
- data/doc/cxxapi/tree.html +0 -249
- data/doc/template/horo.rb +0 -613
- data/ext/libev/config.h +0 -122
- data/ext/nginx/HttpStatusExtractor.h +0 -351
data/ext/libev/config.h
DELETED
@@ -1,122 +0,0 @@
|
|
1
|
-
/* config.h. Generated from config.h.in by configure. */
|
2
|
-
/* config.h.in. Generated from configure.ac by autoheader. */
|
3
|
-
|
4
|
-
/* Define to 1 if you have the `clock_gettime' function. */
|
5
|
-
/* #undef HAVE_CLOCK_GETTIME */
|
6
|
-
|
7
|
-
/* "use syscall interface for clock_gettime" */
|
8
|
-
/* #undef HAVE_CLOCK_SYSCALL */
|
9
|
-
|
10
|
-
/* Define to 1 if you have the <dlfcn.h> header file. */
|
11
|
-
#define HAVE_DLFCN_H 1
|
12
|
-
|
13
|
-
/* Define to 1 if you have the `epoll_ctl' function. */
|
14
|
-
/* #undef HAVE_EPOLL_CTL */
|
15
|
-
|
16
|
-
/* Define to 1 if you have the `eventfd' function. */
|
17
|
-
/* #undef HAVE_EVENTFD */
|
18
|
-
|
19
|
-
/* Define to 1 if you have the `inotify_init' function. */
|
20
|
-
/* #undef HAVE_INOTIFY_INIT */
|
21
|
-
|
22
|
-
/* Define to 1 if you have the <inttypes.h> header file. */
|
23
|
-
#define HAVE_INTTYPES_H 1
|
24
|
-
|
25
|
-
/* Define to 1 if you have the `kqueue' function. */
|
26
|
-
#define HAVE_KQUEUE 1
|
27
|
-
|
28
|
-
/* Define to 1 if you have the `m' library (-lm). */
|
29
|
-
#define HAVE_LIBM 1
|
30
|
-
|
31
|
-
/* Define to 1 if you have the `rt' library (-lrt). */
|
32
|
-
/* #undef HAVE_LIBRT */
|
33
|
-
|
34
|
-
/* Define to 1 if you have the <memory.h> header file. */
|
35
|
-
#define HAVE_MEMORY_H 1
|
36
|
-
|
37
|
-
/* Define to 1 if you have the `nanosleep' function. */
|
38
|
-
/* #undef HAVE_NANOSLEEP */
|
39
|
-
|
40
|
-
/* Define to 1 if you have the `poll' function. */
|
41
|
-
#define HAVE_POLL 1
|
42
|
-
|
43
|
-
/* Define to 1 if you have the <poll.h> header file. */
|
44
|
-
#define HAVE_POLL_H 1
|
45
|
-
|
46
|
-
/* Define to 1 if you have the `port_create' function. */
|
47
|
-
/* #undef HAVE_PORT_CREATE */
|
48
|
-
|
49
|
-
/* Define to 1 if you have the <port.h> header file. */
|
50
|
-
/* #undef HAVE_PORT_H */
|
51
|
-
|
52
|
-
/* Define to 1 if you have the `select' function. */
|
53
|
-
#define HAVE_SELECT 1
|
54
|
-
|
55
|
-
/* Define to 1 if you have the `signalfd' function. */
|
56
|
-
/* #undef HAVE_SIGNALFD */
|
57
|
-
|
58
|
-
/* Define to 1 if you have the <stdint.h> header file. */
|
59
|
-
#define HAVE_STDINT_H 1
|
60
|
-
|
61
|
-
/* Define to 1 if you have the <stdlib.h> header file. */
|
62
|
-
#define HAVE_STDLIB_H 1
|
63
|
-
|
64
|
-
/* Define to 1 if you have the <strings.h> header file. */
|
65
|
-
#define HAVE_STRINGS_H 1
|
66
|
-
|
67
|
-
/* Define to 1 if you have the <string.h> header file. */
|
68
|
-
#define HAVE_STRING_H 1
|
69
|
-
|
70
|
-
/* Define to 1 if you have the <sys/epoll.h> header file. */
|
71
|
-
/* #undef HAVE_SYS_EPOLL_H */
|
72
|
-
|
73
|
-
/* Define to 1 if you have the <sys/eventfd.h> header file. */
|
74
|
-
/* #undef HAVE_SYS_EVENTFD_H */
|
75
|
-
|
76
|
-
/* Define to 1 if you have the <sys/event.h> header file. */
|
77
|
-
#define HAVE_SYS_EVENT_H 1
|
78
|
-
|
79
|
-
/* Define to 1 if you have the <sys/inotify.h> header file. */
|
80
|
-
/* #undef HAVE_SYS_INOTIFY_H */
|
81
|
-
|
82
|
-
/* Define to 1 if you have the <sys/queue.h> header file. */
|
83
|
-
#define HAVE_SYS_QUEUE_H 1
|
84
|
-
|
85
|
-
/* Define to 1 if you have the <sys/select.h> header file. */
|
86
|
-
#define HAVE_SYS_SELECT_H 1
|
87
|
-
|
88
|
-
/* Define to 1 if you have the <sys/signalfd.h> header file. */
|
89
|
-
/* #undef HAVE_SYS_SIGNALFD_H */
|
90
|
-
|
91
|
-
/* Define to 1 if you have the <sys/stat.h> header file. */
|
92
|
-
#define HAVE_SYS_STAT_H 1
|
93
|
-
|
94
|
-
/* Define to 1 if you have the <sys/types.h> header file. */
|
95
|
-
#define HAVE_SYS_TYPES_H 1
|
96
|
-
|
97
|
-
/* Define to 1 if you have the <unistd.h> header file. */
|
98
|
-
#define HAVE_UNISTD_H 1
|
99
|
-
|
100
|
-
/* Name of package */
|
101
|
-
#define PACKAGE "libev"
|
102
|
-
|
103
|
-
/* Define to the address where bug reports for this package should be sent. */
|
104
|
-
#define PACKAGE_BUGREPORT ""
|
105
|
-
|
106
|
-
/* Define to the full name of this package. */
|
107
|
-
#define PACKAGE_NAME ""
|
108
|
-
|
109
|
-
/* Define to the full name and version of this package. */
|
110
|
-
#define PACKAGE_STRING ""
|
111
|
-
|
112
|
-
/* Define to the one symbol short name of this package. */
|
113
|
-
#define PACKAGE_TARNAME ""
|
114
|
-
|
115
|
-
/* Define to the version of this package. */
|
116
|
-
#define PACKAGE_VERSION ""
|
117
|
-
|
118
|
-
/* Define to 1 if you have the ANSI C header files. */
|
119
|
-
#define STDC_HEADERS 1
|
120
|
-
|
121
|
-
/* Version number of package */
|
122
|
-
#define VERSION "3.9"
|
@@ -1,351 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Phusion Passenger - http://www.modrails.com/
|
3
|
-
* Copyright (c) 2010 Phusion
|
4
|
-
*
|
5
|
-
* "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
6
|
-
*
|
7
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
-
* of this software and associated documentation files (the "Software"), to deal
|
9
|
-
* in the Software without restriction, including without limitation the rights
|
10
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
-
* copies of the Software, and to permit persons to whom the Software is
|
12
|
-
* furnished to do so, subject to the following conditions:
|
13
|
-
*
|
14
|
-
* The above copyright notice and this permission notice shall be included in
|
15
|
-
* all copies or substantial portions of the Software.
|
16
|
-
*
|
17
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
|
-
* THE SOFTWARE.
|
24
|
-
*/
|
25
|
-
|
26
|
-
#include <string>
|
27
|
-
#include <cstdio>
|
28
|
-
#include <cstdlib>
|
29
|
-
#include <cstring>
|
30
|
-
|
31
|
-
namespace Passenger {
|
32
|
-
|
33
|
-
using namespace std;
|
34
|
-
|
35
|
-
/**
|
36
|
-
* Utility class for extracting the HTTP status value from an HTTP response.
|
37
|
-
*
|
38
|
-
* This class is used for generating a proper HTTP response. The response data
|
39
|
-
* that Passenger backend processes generate are like CGI responses, and do not
|
40
|
-
* include an initial "HTTP/1.1 [status here]" line, so this class used to
|
41
|
-
* extract the status from the response in order to generate a proper initial
|
42
|
-
* HTTP response line.
|
43
|
-
*
|
44
|
-
* This class is supposed to be used as follows:
|
45
|
-
* - Keep feeding HTTP response data until feed() returns true. feed()
|
46
|
-
* buffers all fed data until it is able to extract the HTTP status.
|
47
|
-
* - Call getStatusLine() to retrieve the status line, and use this to generate
|
48
|
-
* an HTTP response line.
|
49
|
-
* - Call getBuffer() to retrieve all fed data so far. This data can be sent to
|
50
|
-
* the HTTP client.
|
51
|
-
*
|
52
|
-
* This class will also ensure that the status line contains a status text, e.g.
|
53
|
-
* if the HTTP data's status value is only "200" then "OK" will be automatically
|
54
|
-
* appended.
|
55
|
-
*
|
56
|
-
* @note
|
57
|
-
* When the API documentation for this class refers to "\r\n", we actually
|
58
|
-
* mean "\x0D\x0A" (the HTTP line termination string). "\r\n" is only written
|
59
|
-
* out of convenience.
|
60
|
-
*/
|
61
|
-
class HttpStatusExtractor {
|
62
|
-
private:
|
63
|
-
static const char CR = '\x0D';
|
64
|
-
static const char LF = '\x0A';
|
65
|
-
|
66
|
-
string buffer;
|
67
|
-
unsigned int searchStart;
|
68
|
-
bool fullHeaderReceived;
|
69
|
-
string statusLine;
|
70
|
-
|
71
|
-
bool extractStatusLine() {
|
72
|
-
static const char statusHeaderName[] = "Status: ";
|
73
|
-
string::size_type start_pos, newline_pos;
|
74
|
-
|
75
|
-
if (buffer.size() > sizeof(statusHeaderName) - 1
|
76
|
-
&& memcmp(buffer.c_str(), statusHeaderName, sizeof(statusHeaderName) - 1) == 0) {
|
77
|
-
// Status line starts at beginning of the header.
|
78
|
-
start_pos = sizeof(statusHeaderName) - 1;
|
79
|
-
newline_pos = buffer.find("\x0D\x0A", 0, 2) + 2;
|
80
|
-
} else {
|
81
|
-
// Status line is not at the beginning of the header.
|
82
|
-
// Look for it.
|
83
|
-
start_pos = buffer.find("\x0D\x0AStatus: ");
|
84
|
-
if (start_pos != string::npos) {
|
85
|
-
start_pos += 2 + sizeof(statusHeaderName) - 1;
|
86
|
-
newline_pos = buffer.find("\x0D\x0A", start_pos, 2) + 2;
|
87
|
-
}
|
88
|
-
}
|
89
|
-
if (start_pos != string::npos) {
|
90
|
-
// Status line has been found. Extract it.
|
91
|
-
statusLine = buffer.substr(start_pos, newline_pos - start_pos);
|
92
|
-
addStatusTextIfNecessary();
|
93
|
-
return true;
|
94
|
-
} else {
|
95
|
-
// Status line is not found. Do not change default
|
96
|
-
// status line value.
|
97
|
-
return false;
|
98
|
-
}
|
99
|
-
}
|
100
|
-
|
101
|
-
void addStatusTextIfNecessary() {
|
102
|
-
if (statusLine.find(' ') == string::npos) {
|
103
|
-
// The status line doesn't contain a status text, so add it.
|
104
|
-
int statusCode = atoi(statusLine.c_str());
|
105
|
-
switch (statusCode) {
|
106
|
-
case 100:
|
107
|
-
statusLine = "100 Continue\x0D\x0A";
|
108
|
-
break;
|
109
|
-
case 101:
|
110
|
-
statusLine = "101 Switching Protocols\x0D\x0A";
|
111
|
-
break;
|
112
|
-
case 102:
|
113
|
-
statusLine = "102 Processing\x0D\x0A";
|
114
|
-
break;
|
115
|
-
case 200:
|
116
|
-
statusLine = "200 OK\x0D\x0A";
|
117
|
-
break;
|
118
|
-
case 201:
|
119
|
-
statusLine = "201 Created\x0D\x0A";
|
120
|
-
break;
|
121
|
-
case 202:
|
122
|
-
statusLine = "202 Accepted\x0D\x0A";
|
123
|
-
break;
|
124
|
-
case 203:
|
125
|
-
statusLine = "203 Non-Authoritative Information\x0D\x0A";
|
126
|
-
break;
|
127
|
-
case 204:
|
128
|
-
statusLine = "204 No Content\x0D\x0A";
|
129
|
-
break;
|
130
|
-
case 205:
|
131
|
-
statusLine = "205 Reset Content\x0D\x0A";
|
132
|
-
break;
|
133
|
-
case 206:
|
134
|
-
statusLine = "206 Partial Content\x0D\x0A";
|
135
|
-
break;
|
136
|
-
case 207:
|
137
|
-
statusLine = "207 Multi-Status\x0D\x0A";
|
138
|
-
break;
|
139
|
-
case 300:
|
140
|
-
statusLine = "300 Multiple Choices\x0D\x0A";
|
141
|
-
break;
|
142
|
-
case 301:
|
143
|
-
statusLine = "301 Moved Permanently\x0D\x0A";
|
144
|
-
break;
|
145
|
-
case 302:
|
146
|
-
statusLine = "302 Found\x0D\x0A";
|
147
|
-
break;
|
148
|
-
case 303:
|
149
|
-
statusLine = "303 See Other\x0D\x0A";
|
150
|
-
break;
|
151
|
-
case 304:
|
152
|
-
statusLine = "304 Not Modified\x0D\x0A";
|
153
|
-
break;
|
154
|
-
case 305:
|
155
|
-
statusLine = "305 Use Proxy\x0D\x0A";
|
156
|
-
break;
|
157
|
-
case 306:
|
158
|
-
statusLine = "306 Switch Proxy\x0D\x0A";
|
159
|
-
break;
|
160
|
-
case 307:
|
161
|
-
statusLine = "307 Temporary Redirect\x0D\x0A";
|
162
|
-
break;
|
163
|
-
case 308:
|
164
|
-
// Google Gears: http://code.google.com/p/gears/wiki/ResumableHttpRequestsProposal
|
165
|
-
statusLine = "308 Resume Incomplete\x0D\x0A";
|
166
|
-
break;
|
167
|
-
case 400:
|
168
|
-
statusLine = "400 Bad Request\x0D\x0A";
|
169
|
-
break;
|
170
|
-
case 401:
|
171
|
-
statusLine = "401 Unauthorized\x0D\x0A";
|
172
|
-
break;
|
173
|
-
case 402:
|
174
|
-
statusLine = "402 Payment Required\x0D\x0A";
|
175
|
-
break;
|
176
|
-
case 403:
|
177
|
-
statusLine = "403 Forbidden\x0D\x0A";
|
178
|
-
break;
|
179
|
-
case 404:
|
180
|
-
statusLine = "404 Not Found\x0D\x0A";
|
181
|
-
break;
|
182
|
-
case 405:
|
183
|
-
statusLine = "405 Method Not Allowed\x0D\x0A";
|
184
|
-
break;
|
185
|
-
case 406:
|
186
|
-
statusLine = "406 Not Acceptable\x0D\x0A";
|
187
|
-
break;
|
188
|
-
case 407:
|
189
|
-
statusLine = "407 Proxy Authentication Required\x0D\x0A";
|
190
|
-
break;
|
191
|
-
case 408:
|
192
|
-
statusLine = "408 Request Timeout\x0D\x0A";
|
193
|
-
break;
|
194
|
-
case 409:
|
195
|
-
statusLine = "409 Conflict\x0D\x0A";
|
196
|
-
break;
|
197
|
-
case 410:
|
198
|
-
statusLine = "410 Gone\x0D\x0A";
|
199
|
-
break;
|
200
|
-
case 411:
|
201
|
-
statusLine = "411 Length Required\x0D\x0A";
|
202
|
-
break;
|
203
|
-
case 412:
|
204
|
-
statusLine = "412 Precondition Failed\x0D\x0A";
|
205
|
-
break;
|
206
|
-
case 413:
|
207
|
-
statusLine = "413 Request Entity Too Large\x0D\x0A";
|
208
|
-
break;
|
209
|
-
case 414:
|
210
|
-
statusLine = "414 Request-URI Too Long\x0D\x0A";
|
211
|
-
break;
|
212
|
-
case 415:
|
213
|
-
statusLine = "415 Unsupported Media Type\x0D\x0A";
|
214
|
-
break;
|
215
|
-
case 416:
|
216
|
-
statusLine = "416 Requested Range Not Satisfiable\x0D\x0A";
|
217
|
-
break;
|
218
|
-
case 417:
|
219
|
-
statusLine = "417 Expectation Failed\x0D\x0A";
|
220
|
-
break;
|
221
|
-
case 418:
|
222
|
-
statusLine = "418 Not A Funny April Fools Joke\x0D\x0A";
|
223
|
-
break;
|
224
|
-
case 422:
|
225
|
-
statusLine = "422 Unprocessable Entity\x0D\x0A";
|
226
|
-
break;
|
227
|
-
case 423:
|
228
|
-
statusLine = "423 Locked\x0D\x0A";
|
229
|
-
break;
|
230
|
-
case 424:
|
231
|
-
statusLine = "424 Unordered Collection\x0D\x0A";
|
232
|
-
break;
|
233
|
-
case 426:
|
234
|
-
statusLine = "426 Upgrade Required\x0D\x0A";
|
235
|
-
break;
|
236
|
-
case 449:
|
237
|
-
statusLine = "449 Retry With\x0D\x0A";
|
238
|
-
break;
|
239
|
-
case 450:
|
240
|
-
statusLine = "450 Blocked\x0D\x0A";
|
241
|
-
break;
|
242
|
-
case 500:
|
243
|
-
statusLine = "500 Internal Server Error\x0D\x0A";
|
244
|
-
break;
|
245
|
-
case 501:
|
246
|
-
statusLine = "501 Not Implemented\x0D\x0A";
|
247
|
-
break;
|
248
|
-
case 502:
|
249
|
-
statusLine = "502 Bad Gateway\x0D\x0A";
|
250
|
-
break;
|
251
|
-
case 503:
|
252
|
-
statusLine = "503 Service Unavailable\x0D\x0A";
|
253
|
-
break;
|
254
|
-
case 504:
|
255
|
-
statusLine = "504 Gateway Timeout\x0D\x0A";
|
256
|
-
break;
|
257
|
-
case 505:
|
258
|
-
statusLine = "505 HTTP Version Not Supported\x0D\x0A";
|
259
|
-
break;
|
260
|
-
case 506:
|
261
|
-
statusLine = "506 Variant Also Negotiates\x0D\x0A";
|
262
|
-
break;
|
263
|
-
case 507:
|
264
|
-
statusLine = "507 Insufficient Storage\x0D\x0A";
|
265
|
-
break;
|
266
|
-
case 509:
|
267
|
-
statusLine = "509 Bandwidth Limit Exceeded\x0D\x0A";
|
268
|
-
break;
|
269
|
-
case 510:
|
270
|
-
statusLine = "510 Not Extended\x0D\x0A";
|
271
|
-
break;
|
272
|
-
default:
|
273
|
-
char temp[32];
|
274
|
-
snprintf(temp, sizeof(temp),
|
275
|
-
"%d Unknown Status Code\x0D\x0A",
|
276
|
-
statusCode);
|
277
|
-
temp[sizeof(temp) - 1] = '\0';
|
278
|
-
statusLine = temp;
|
279
|
-
}
|
280
|
-
}
|
281
|
-
}
|
282
|
-
|
283
|
-
public:
|
284
|
-
HttpStatusExtractor() {
|
285
|
-
searchStart = 0;
|
286
|
-
fullHeaderReceived = false;
|
287
|
-
statusLine = "200 OK\r\n";
|
288
|
-
}
|
289
|
-
|
290
|
-
/**
|
291
|
-
* Feed HTTP response data to this HttpStatusExtractor.
|
292
|
-
*
|
293
|
-
* One is to keep feeding data until this method returns true.
|
294
|
-
* When a sufficient amount of data has been fed, this method will
|
295
|
-
* extract the status line from the data that has been fed so far,
|
296
|
-
* and return true.
|
297
|
-
*
|
298
|
-
* Do not call this method again once it has returned true.
|
299
|
-
*
|
300
|
-
* It is safe to feed excess data. That is, it is safe if the 'data'
|
301
|
-
* argument contains a part of the HTTP response body.
|
302
|
-
* HttpStatusExtractor will only look for the status line in the HTTP
|
303
|
-
* response header, not in the HTTP response body. All fed data is
|
304
|
-
* buffered and will be available via getBuffer(), so no data will be
|
305
|
-
* lost.
|
306
|
-
*
|
307
|
-
* @return Whether the HTTP status has been extracted yet.
|
308
|
-
* @pre feed() did not previously return true.
|
309
|
-
* @pre data != NULL
|
310
|
-
* @pre size > 0
|
311
|
-
*/
|
312
|
-
bool feed(const char *data, unsigned int size) {
|
313
|
-
if (fullHeaderReceived) {
|
314
|
-
return true;
|
315
|
-
}
|
316
|
-
buffer.append(data, size);
|
317
|
-
for (; buffer.size() >= 3 && searchStart < buffer.size() - 3; searchStart++) {
|
318
|
-
if (buffer[searchStart] == CR &&
|
319
|
-
buffer[searchStart + 1] == LF &&
|
320
|
-
buffer[searchStart + 2] == CR &&
|
321
|
-
buffer[searchStart + 3] == LF) {
|
322
|
-
fullHeaderReceived = true;
|
323
|
-
extractStatusLine();
|
324
|
-
return true;
|
325
|
-
}
|
326
|
-
}
|
327
|
-
return false;
|
328
|
-
}
|
329
|
-
|
330
|
-
/**
|
331
|
-
* Returns the HTTP status line that has been determined.
|
332
|
-
*
|
333
|
-
* The default value is "200 OK\r\n", which is returned if the HTTP
|
334
|
-
* response data that has been fed so far does not include a status
|
335
|
-
* line.
|
336
|
-
*
|
337
|
-
* @note The return value includes a trailing CRLF, e.g. "404 Not Found\r\n".
|
338
|
-
*/
|
339
|
-
string getStatusLine() const {
|
340
|
-
return statusLine;
|
341
|
-
}
|
342
|
-
|
343
|
-
/**
|
344
|
-
* Get the data that has been fed so far.
|
345
|
-
*/
|
346
|
-
string getBuffer() const {
|
347
|
-
return buffer;
|
348
|
-
}
|
349
|
-
};
|
350
|
-
|
351
|
-
} // namespace Passenger
|