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
@@ -52,7 +52,9 @@ tracable_exception::tracable_exception() {
|
|
52
52
|
}
|
53
53
|
}
|
54
54
|
|
55
|
-
tracable_exception::tracable_exception(const tracable_exception &other)
|
55
|
+
tracable_exception::tracable_exception(const tracable_exception &other)
|
56
|
+
: std::exception()
|
57
|
+
{
|
56
58
|
list<trace_point *>::const_iterator it;
|
57
59
|
for (it = other.backtrace_copy.begin(); it != other.backtrace_copy.end(); it++) {
|
58
60
|
trace_point *p = new trace_point(
|
data/ext/ruby/extconf.rb
CHANGED
@@ -276,6 +276,9 @@ close_all_file_descriptors(VALUE self, VALUE exceptions) {
|
|
276
276
|
|
277
277
|
for (i = sysconf(_SC_OPEN_MAX) - 1; i >= 0; i--) {
|
278
278
|
int is_exception = 0;
|
279
|
+
#ifdef HAVE_RB_RESERVED_FD_P
|
280
|
+
is_exception = rb_reserved_fd_p(i);
|
281
|
+
#endif
|
279
282
|
for (j = 0; j < RARRAY_LEN(exceptions) && !is_exception; j++) {
|
280
283
|
long fd = NUM2INT(rb_ary_entry(exceptions, j));
|
281
284
|
is_exception = i == fd;
|
data/helper-scripts/prespawn
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# Phusion Passenger - http://www.modrails.com/
|
3
|
-
# Copyright (c) 2010 Phusion
|
3
|
+
# Copyright (c) 2010, 2011 Phusion
|
4
4
|
#
|
5
5
|
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
6
6
|
#
|
@@ -26,38 +26,120 @@ STDOUT.sync = true
|
|
26
26
|
STDERR.sync = true
|
27
27
|
|
28
28
|
require 'uri'
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
29
|
+
require 'socket'
|
30
|
+
|
31
|
+
class PrespawnLocation
|
32
|
+
class InvalidURLError < RuntimeError
|
33
|
+
def initialize(url)
|
34
|
+
@url = url
|
35
|
+
end
|
36
|
+
|
37
|
+
def to_s
|
38
|
+
message
|
39
|
+
end
|
40
|
+
|
41
|
+
def message
|
42
|
+
"'#{@url}' is not a valid URL."
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.parse(url)
|
47
|
+
uri = uri_for(url)
|
48
|
+
|
49
|
+
location = if uri.host == 'unix'
|
50
|
+
UNIXPrespawnLocation.new(uri)
|
51
|
+
else
|
52
|
+
case uri.scheme
|
53
|
+
when 'http'
|
54
|
+
TCPPrespawnLocation.new(uri)
|
55
|
+
when 'https'
|
56
|
+
SSLPrespawnLocation.new(uri)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
unless location
|
61
|
+
raise InvalidURLError, url
|
62
|
+
end
|
63
|
+
|
64
|
+
location
|
65
|
+
end
|
66
|
+
|
67
|
+
def self.uri_for(url)
|
68
|
+
URI.parse(url)
|
69
|
+
rescue URI::InvalidURIError
|
70
|
+
raise InvalidURLError, url
|
71
|
+
end
|
72
|
+
|
73
|
+
def initialize(uri)
|
74
|
+
@uri = uri
|
75
|
+
end
|
76
|
+
|
77
|
+
def request_path
|
78
|
+
@uri.path.empty? ? '/' : @uri.path
|
79
|
+
end
|
80
|
+
|
81
|
+
def request_host
|
82
|
+
@uri.host
|
83
|
+
end
|
84
|
+
|
85
|
+
def socket
|
86
|
+
@socket ||= connect
|
87
|
+
end
|
88
|
+
|
89
|
+
def head_request
|
90
|
+
socket.write("HEAD #{request_path} HTTP/1.1\r\n")
|
91
|
+
socket.write("Host: #{request_host}\r\n")
|
92
|
+
socket.write("Connection: close\r\n")
|
93
|
+
socket.write("\r\n")
|
94
|
+
|
95
|
+
socket.read
|
96
|
+
end
|
35
97
|
end
|
36
|
-
|
37
|
-
|
38
|
-
|
98
|
+
|
99
|
+
class TCPPrespawnLocation < PrespawnLocation
|
100
|
+
def request_port
|
101
|
+
@uri.port
|
102
|
+
end
|
103
|
+
|
104
|
+
def connect
|
105
|
+
TCPSocket.new(request_host, request_port)
|
106
|
+
end
|
39
107
|
end
|
40
108
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
109
|
+
class SSLPrespawnLocation < TCPPrespawnLocation
|
110
|
+
def connect
|
111
|
+
require 'openssl'
|
112
|
+
socket = OpenSSL::SSL::SSLSocket.new(super)
|
113
|
+
socket.sync_close = true
|
114
|
+
socket.connect
|
115
|
+
socket
|
116
|
+
end
|
49
117
|
end
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
socket.write("\r\n")
|
55
|
-
if socket.respond_to?(:close_write)
|
56
|
-
socket.close_write
|
57
|
-
socket.read
|
58
|
-
else
|
59
|
-
socket.readline
|
118
|
+
|
119
|
+
class UNIXPrespawnLocation < PrespawnLocation
|
120
|
+
def request_path
|
121
|
+
super.split(':', 2).last
|
60
122
|
end
|
61
|
-
|
62
|
-
|
63
|
-
|
123
|
+
|
124
|
+
def request_host
|
125
|
+
'_'
|
126
|
+
end
|
127
|
+
|
128
|
+
def socket_path
|
129
|
+
@uri.path.split(':', 2).first
|
130
|
+
end
|
131
|
+
|
132
|
+
def connect
|
133
|
+
UNIXSocket.new(socket_path)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
url = ARGV[0]
|
138
|
+
begin
|
139
|
+
prespawn_location = PrespawnLocation.parse(url)
|
140
|
+
rescue PrespawnLocation::InvalidURLError => e
|
141
|
+
STDERR.puts "*** ERROR: #{e}"
|
142
|
+
exit 1
|
143
|
+
end
|
144
|
+
|
145
|
+
prespawn_location.head_request
|
data/lib/phusion_passenger.rb
CHANGED
@@ -25,9 +25,9 @@ module PhusionPassenger
|
|
25
25
|
###### Version numbers ######
|
26
26
|
|
27
27
|
# Phusion Passenger version number. Don't forget to edit ext/common/Constants.h too.
|
28
|
-
VERSION_STRING = '3.0.
|
28
|
+
VERSION_STRING = '3.0.8'
|
29
29
|
|
30
|
-
PREFERRED_NGINX_VERSION = '1.0.
|
30
|
+
PREFERRED_NGINX_VERSION = '1.0.5'
|
31
31
|
PREFERRED_PCRE_VERSION = '8.12'
|
32
32
|
STANDALONE_INTERFACE_VERSION = 1
|
33
33
|
|
@@ -307,7 +307,7 @@ private
|
|
307
307
|
if !File.directory?(dir)
|
308
308
|
FileUtils.mkdir_p(dir)
|
309
309
|
end
|
310
|
-
FileUtils.install(filename, "#{target}/#{filename}")
|
310
|
+
FileUtils.install(filename, "#{target}/#{filename}", :mode => File.stat(filename).mode)
|
311
311
|
yield(i + 1, files.size)
|
312
312
|
end
|
313
313
|
end
|
@@ -317,7 +317,7 @@ private
|
|
317
317
|
end
|
318
318
|
|
319
319
|
def run_rake_task!(target)
|
320
|
-
total_lines = `#{rake} #{target} --dry-run`.split("\n").size - 1
|
320
|
+
total_lines = `#{rake} #{target} --dry-run STDERR_TO_STDOUT=1`.split("\n").size - 1
|
321
321
|
backlog = ""
|
322
322
|
|
323
323
|
IO.popen("#{rake} #{target} --trace STDERR_TO_STDOUT=1", "r") do |io|
|
@@ -437,6 +437,7 @@ private
|
|
437
437
|
# work around the problem by configure Nginx with prefix
|
438
438
|
# /tmp.
|
439
439
|
command = "sh ./configure --prefix=/tmp " <<
|
440
|
+
"--with-cc-opt='-Wno-error' " <<
|
440
441
|
"--without-pcre " <<
|
441
442
|
"--without-http_rewrite_module " <<
|
442
443
|
"--without-http_fastcgi_module " <<
|
@@ -267,10 +267,6 @@ private
|
|
267
267
|
return !@options[:daemonize] && @options[:log_file] != "/dev/null"
|
268
268
|
end
|
269
269
|
|
270
|
-
def listening_on_unix_domain_socket?
|
271
|
-
return !!@options[:socket_file]
|
272
|
-
end
|
273
|
-
|
274
270
|
# Returns the URL that Nginx will be listening on.
|
275
271
|
def listen_url
|
276
272
|
if @options[:socket_file]
|
@@ -408,16 +404,20 @@ private
|
|
408
404
|
end
|
409
405
|
|
410
406
|
IO.popen("tail -f -n #{backward} \"#{log_file}\"", "rb") do |f|
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
407
|
+
begin
|
408
|
+
while true
|
409
|
+
begin
|
410
|
+
line = f.readline
|
411
|
+
@console_mutex.synchronize do
|
412
|
+
STDOUT.write(line)
|
413
|
+
STDOUT.flush
|
414
|
+
end
|
415
|
+
rescue EOFError
|
416
|
+
break
|
417
417
|
end
|
418
|
-
rescue EOFError
|
419
|
-
break
|
420
418
|
end
|
419
|
+
ensure
|
420
|
+
Process.kill('TERM', f.pid)
|
421
421
|
end
|
422
422
|
end
|
423
423
|
end
|
@@ -0,0 +1,216 @@
|
|
1
|
+
#include "TestSupport.h"
|
2
|
+
#include <algorithm>
|
3
|
+
#include <string>
|
4
|
+
#include <Utils/Dechunker.h>
|
5
|
+
#include <Utils/StrIntUtils.h>
|
6
|
+
|
7
|
+
using namespace Passenger;
|
8
|
+
using namespace std;
|
9
|
+
|
10
|
+
namespace tut {
|
11
|
+
struct DechunkerTest {
|
12
|
+
Dechunker dechunker;
|
13
|
+
string input;
|
14
|
+
vector<string> chunks;
|
15
|
+
|
16
|
+
DechunkerTest() {
|
17
|
+
dechunker.onData = onData;
|
18
|
+
dechunker.userData = this;
|
19
|
+
}
|
20
|
+
|
21
|
+
void addChunk(const string &data) {
|
22
|
+
input.append(integerToHex(data.size()));
|
23
|
+
input.append("\r\n");
|
24
|
+
input.append(data);
|
25
|
+
input.append("\r\n");
|
26
|
+
}
|
27
|
+
|
28
|
+
static void onData(const char *data, size_t len, void *userData) {
|
29
|
+
DechunkerTest *self = (DechunkerTest *) userData;
|
30
|
+
self->chunks.push_back(string(data, len));
|
31
|
+
}
|
32
|
+
};
|
33
|
+
|
34
|
+
DEFINE_TEST_GROUP(DechunkerTest);
|
35
|
+
|
36
|
+
TEST_METHOD(1) {
|
37
|
+
// Test initial state.
|
38
|
+
ensure(dechunker.acceptingInput());
|
39
|
+
ensure(!dechunker.hasError());
|
40
|
+
ensure_equals(dechunker.getErrorMessage(), (const char *) NULL);
|
41
|
+
}
|
42
|
+
|
43
|
+
TEST_METHOD(2) {
|
44
|
+
// Test feeding a complete stream everything in one go.
|
45
|
+
addChunk("hello");
|
46
|
+
addChunk("world");
|
47
|
+
addChunk("");
|
48
|
+
ensure_equals(dechunker.feed(input.data(), input.size()), input.size());
|
49
|
+
ensure(!dechunker.acceptingInput());
|
50
|
+
ensure(!dechunker.hasError());
|
51
|
+
ensure_equals(chunks.size(), 2u);
|
52
|
+
ensure_equals(chunks[0], "hello");
|
53
|
+
ensure_equals(chunks[1], "world");
|
54
|
+
}
|
55
|
+
|
56
|
+
TEST_METHOD(3) {
|
57
|
+
// Test feeding a complete stream byte by byte.
|
58
|
+
addChunk("hel");
|
59
|
+
addChunk("lo");
|
60
|
+
addChunk("");
|
61
|
+
|
62
|
+
const char *pos = input.data();
|
63
|
+
const char *end = input.data() + input.size();
|
64
|
+
while (pos < end) {
|
65
|
+
ensure(dechunker.acceptingInput());
|
66
|
+
ensure(!dechunker.hasError());
|
67
|
+
ensure_equals(dechunker.feed(pos, 1), 1u);
|
68
|
+
pos++;
|
69
|
+
}
|
70
|
+
|
71
|
+
ensure(!dechunker.acceptingInput());
|
72
|
+
ensure(!dechunker.hasError());
|
73
|
+
ensure_equals(chunks.size(), 5u);
|
74
|
+
ensure_equals(chunks[0], "h");
|
75
|
+
ensure_equals(chunks[1], "e");
|
76
|
+
ensure_equals(chunks[2], "l");
|
77
|
+
ensure_equals(chunks[3], "l");
|
78
|
+
ensure_equals(chunks[4], "o");
|
79
|
+
}
|
80
|
+
|
81
|
+
TEST_METHOD(4) {
|
82
|
+
// Test feeding a complete stream in pieces of 2 bytes.
|
83
|
+
addChunk("hello");
|
84
|
+
addChunk("world");
|
85
|
+
addChunk("");
|
86
|
+
|
87
|
+
const char *pos = input.data();
|
88
|
+
const char *end = input.data() + input.size();
|
89
|
+
while (pos < end) {
|
90
|
+
ensure(dechunker.acceptingInput());
|
91
|
+
ensure(!dechunker.hasError());
|
92
|
+
size_t size = std::min<size_t>(2, end - pos);
|
93
|
+
ensure_equals(dechunker.feed(pos, size), size);
|
94
|
+
pos += 2;
|
95
|
+
}
|
96
|
+
|
97
|
+
ensure(!dechunker.acceptingInput());
|
98
|
+
ensure(!dechunker.hasError());
|
99
|
+
ensure_equals(chunks.size(), 6u);
|
100
|
+
ensure_equals(chunks[0], "h");
|
101
|
+
ensure_equals(chunks[1], "el");
|
102
|
+
ensure_equals(chunks[2], "lo");
|
103
|
+
ensure_equals(chunks[3], "w");
|
104
|
+
ensure_equals(chunks[4], "or");
|
105
|
+
ensure_equals(chunks[5], "ld");
|
106
|
+
}
|
107
|
+
|
108
|
+
TEST_METHOD(5) {
|
109
|
+
// Test feeding a complete stream in pieces of 3 bytes.
|
110
|
+
addChunk("hello");
|
111
|
+
addChunk("world");
|
112
|
+
addChunk("");
|
113
|
+
|
114
|
+
const char *pos = input.data();
|
115
|
+
const char *end = input.data() + input.size();
|
116
|
+
while (pos < end) {
|
117
|
+
ensure(dechunker.acceptingInput());
|
118
|
+
ensure(!dechunker.hasError());
|
119
|
+
size_t size = std::min<size_t>(3, end - pos);
|
120
|
+
ensure_equals(dechunker.feed(pos, size), size);
|
121
|
+
pos += 3;
|
122
|
+
}
|
123
|
+
|
124
|
+
ensure(!dechunker.acceptingInput());
|
125
|
+
ensure(!dechunker.hasError());
|
126
|
+
ensure_equals(chunks.size(), 4u);
|
127
|
+
ensure_equals(chunks[0], "hel");
|
128
|
+
ensure_equals(chunks[1], "lo");
|
129
|
+
ensure_equals(chunks[2], "wo");
|
130
|
+
ensure_equals(chunks[3], "rld");
|
131
|
+
}
|
132
|
+
|
133
|
+
TEST_METHOD(6) {
|
134
|
+
// Test support for chunk extensions.
|
135
|
+
input = "2;foobar\r\n"
|
136
|
+
"xy\r\n"
|
137
|
+
"0\r\n"
|
138
|
+
"\r\n";
|
139
|
+
ensure_equals(dechunker.feed(input.data(), input.size()), input.size());
|
140
|
+
ensure(!dechunker.acceptingInput());
|
141
|
+
ensure(!dechunker.hasError());
|
142
|
+
ensure_equals(chunks.size(), 1u);
|
143
|
+
ensure_equals(chunks[0], "xy");
|
144
|
+
}
|
145
|
+
|
146
|
+
TEST_METHOD(20) {
|
147
|
+
// It refuses to accept any more data after EOF until reset is called.
|
148
|
+
addChunk("hello");
|
149
|
+
addChunk("");
|
150
|
+
|
151
|
+
dechunker.feed(input.data(), input.size());
|
152
|
+
ensure_equals(dechunker.feed(input.data(), input.size()), 0u);
|
153
|
+
dechunker.reset();
|
154
|
+
ensure_equals(dechunker.feed(input.data(), input.size()), input.size());
|
155
|
+
ensure(!dechunker.acceptingInput());
|
156
|
+
ensure(!dechunker.hasError());
|
157
|
+
|
158
|
+
ensure_equals(chunks.size(), 2u);
|
159
|
+
ensure_equals(chunks[0], "hello");
|
160
|
+
ensure_equals(chunks[1], "hello");
|
161
|
+
}
|
162
|
+
|
163
|
+
TEST_METHOD(21) {
|
164
|
+
// Test invalid size string.
|
165
|
+
input = "12x\r\n";
|
166
|
+
ensure_equals(dechunker.feed(input.data(), input.size()), 2u);
|
167
|
+
ensure(!dechunker.acceptingInput());
|
168
|
+
ensure(dechunker.hasError());
|
169
|
+
}
|
170
|
+
|
171
|
+
TEST_METHOD(22) {
|
172
|
+
// Test invalid chunk header terminator.
|
173
|
+
input = "12\r\t";
|
174
|
+
ensure_equals(dechunker.feed(input.data(), input.size()), 3u);
|
175
|
+
ensure(!dechunker.acceptingInput());
|
176
|
+
ensure(dechunker.hasError());
|
177
|
+
}
|
178
|
+
|
179
|
+
TEST_METHOD(23) {
|
180
|
+
// Test invalid chunk header terminator when chunk extensions are involved.
|
181
|
+
input = "12;foo\r\t";
|
182
|
+
ensure_equals(dechunker.feed(input.data(), input.size()), 7u);
|
183
|
+
ensure(!dechunker.acceptingInput());
|
184
|
+
ensure(dechunker.hasError());
|
185
|
+
}
|
186
|
+
|
187
|
+
TEST_METHOD(24) {
|
188
|
+
// Test invalid chunk terminator.
|
189
|
+
input = "2\r\n"
|
190
|
+
"xyz";
|
191
|
+
ensure_equals(dechunker.feed(input.data(), input.size()), 5u);
|
192
|
+
ensure(!dechunker.acceptingInput());
|
193
|
+
ensure(dechunker.hasError());
|
194
|
+
}
|
195
|
+
|
196
|
+
TEST_METHOD(25) {
|
197
|
+
// Test invalid terminating chunk terminator.
|
198
|
+
input = "2\r\n"
|
199
|
+
"xy\r\n"
|
200
|
+
"0\r\n"
|
201
|
+
"\rx";
|
202
|
+
ensure_equals(dechunker.feed(input.data(), input.size()), 11u);
|
203
|
+
ensure(!dechunker.acceptingInput());
|
204
|
+
ensure(dechunker.hasError());
|
205
|
+
}
|
206
|
+
|
207
|
+
TEST_METHOD(26) {
|
208
|
+
// Test garbage.
|
209
|
+
for (int i = 0; i < 256; i++) {
|
210
|
+
input.append(1, (char) i);
|
211
|
+
}
|
212
|
+
dechunker.feed(input.data(), input.size());
|
213
|
+
ensure(!dechunker.acceptingInput());
|
214
|
+
ensure(dechunker.hasError());
|
215
|
+
}
|
216
|
+
}
|