mongrel 0.3.12.4 → 0.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +44 -33
- data/bin/mongrel_rails +67 -34
- data/doc/rdoc/classes/IO.html +10 -10
- data/doc/rdoc/classes/IO.src/{M000005.html → M000001.html} +5 -5
- data/doc/rdoc/classes/IO.src/{M000006.html → M000002.html} +5 -5
- data/doc/rdoc/classes/Kernel.html +10 -10
- data/doc/rdoc/classes/Kernel.src/{M000025.html → M000020.html} +5 -5
- data/doc/rdoc/classes/Kernel.src/M000021.html +23 -0
- data/doc/rdoc/classes/Mongrel.html +25 -4
- data/doc/rdoc/classes/Mongrel/CGIWrapper.html +383 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000096.html +11 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000097.html +34 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000098.html +21 -6
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000093.html → M000099.html} +13 -13
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000094.html → M000100.html} +11 -11
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000095.html → M000101.html} +4 -4
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000102.html +18 -0
- data/doc/rdoc/classes/Mongrel/{URIClassifier.src/M000084.html → CGIWrapper.src/M000103.html} +5 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000104.html +19 -0
- data/doc/rdoc/classes/Mongrel/Camping.html +5 -5
- data/doc/rdoc/classes/Mongrel/Camping.src/M000046.html +22 -0
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +10 -10
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/{M000049.html → M000047.html} +4 -4
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000048.html +51 -0
- data/doc/rdoc/classes/Mongrel/Command.html +13 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.html +95 -50
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000024.html +24 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000025.html +42 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000026.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000027.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000028.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000029.html +5 -11
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000030.html +9 -28
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000031.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000032.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000033.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000034.html +11 -9
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000035.html +11 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000036.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Registry.html +15 -15
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000037.html +20 -0
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/{M000040.html → M000038.html} +11 -11
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000039.html +37 -7
- data/doc/rdoc/classes/Mongrel/Configurator.html +651 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000105.html +16 -20
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000106.html +18 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000107.html +7 -11
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000108.html +7 -6
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000109.html +10 -9
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000110.html +5 -8
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000111.html +21 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000112.html +6 -15
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000113.html +17 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000114.html +20 -33
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000115.html +5 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000116.html +24 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000117.html +19 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000118.html +22 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000119.html +25 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000120.html +18 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000121.html +35 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000122.html +18 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000123.html +33 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000124.html +18 -0
- data/doc/rdoc/classes/Mongrel/Const.html +39 -7
- data/doc/rdoc/classes/Mongrel/DeflateFilter.html +181 -0
- data/doc/rdoc/classes/Mongrel/DeflateFilter.src/M000094.html +19 -0
- data/doc/rdoc/classes/Mongrel/DeflateFilter.src/M000095.html +28 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.html +48 -33
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000056.html +21 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000057.html +43 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000058.html +29 -7
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000059.html +50 -29
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000060.html +26 -27
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000061.html +5 -38
- data/doc/rdoc/classes/Mongrel/Error404Handler.html +171 -0
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000116.html → M000125.html} +4 -4
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000117.html → M000126.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HeaderOut.html +185 -0
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000072.html → M000069.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000073.html → M000070.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HttpHandler.html +170 -0
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000074.html → M000075.html} +3 -3
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.html +20 -10
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/{M000027.html → M000022.html} +5 -4
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/{M000028.html → M000023.html} +3 -3
- data/doc/rdoc/classes/Mongrel/HttpParser.html +41 -36
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000056.html → M000049.html} +6 -5
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000057.html → M000050.html} +7 -6
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000051.html +7 -6
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000052.html +37 -7
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000053.html +5 -7
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000054.html +6 -22
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000055.html +6 -5
- data/doc/rdoc/classes/Mongrel/HttpRequest.html +239 -0
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000130.html +52 -0
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000119.html → M000131.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000120.html → M000132.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000121.html → M000133.html} +18 -18
- data/doc/rdoc/classes/Mongrel/HttpResponse.html +439 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000076.html +12 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000077.html +7 -12
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000078.html +12 -9
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000079.html +9 -9
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000080.html +9 -10
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000081.html +9 -5
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000082.html +18 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000083.html +8 -5
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000084.html +20 -0
- data/doc/rdoc/classes/Mongrel/{HttpServer.src/M000069.html → HttpResponse.src/M000085.html} +7 -5
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000086.html +20 -0
- data/doc/rdoc/classes/Mongrel/{Configurator.src/M000101.html → HttpResponse.src/M000087.html} +5 -5
- data/doc/rdoc/classes/Mongrel/HttpServer.html +68 -59
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000062.html +25 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000063.html +83 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000064.html +13 -11
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000065.html +50 -53
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000066.html +21 -11
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000067.html +5 -47
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000068.html +9 -15
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.html +16 -16
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000040.html +39 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/{M000043.html → M000041.html} +11 -11
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000042.html +13 -22
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.html +17 -17
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000043.html +22 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000044.html +51 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000045.html +10 -9
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.html +211 -0
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000127.html +24 -0
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000128.html +24 -0
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000129.html +18 -0
- data/doc/rdoc/classes/{Class.html → Mongrel/StatusHandler.html} +42 -45
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000071.html +18 -0
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000072.html +24 -0
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000073.html +42 -0
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000074.html +20 -0
- data/doc/rdoc/classes/Mongrel/StopServer.html +117 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.html +314 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000088.html +5 -23
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000089.html +5 -70
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000086.html → M000090.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000087.html → M000091.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000092.html +36 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000093.html +83 -0
- data/doc/rdoc/classes/MongrelDbg.html +25 -25
- data/doc/rdoc/classes/MongrelDbg.src/{M000020.html → M000015.html} +5 -5
- data/doc/rdoc/classes/MongrelDbg.src/{M000021.html → M000016.html} +6 -6
- data/doc/rdoc/classes/MongrelDbg.src/{M000022.html → M000017.html} +8 -8
- data/doc/rdoc/classes/MongrelDbg.src/{M000023.html → M000018.html} +7 -7
- data/doc/rdoc/classes/MongrelDbg.src/{M000024.html → M000019.html} +4 -4
- data/doc/rdoc/classes/ObjectTracker.html +10 -40
- data/doc/rdoc/classes/ObjectTracker.src/M000013.html +27 -0
- data/doc/rdoc/classes/ObjectTracker.src/M000014.html +44 -0
- data/doc/rdoc/classes/RequestLog.html +115 -0
- data/doc/rdoc/classes/RequestLog/Access.html +151 -0
- data/doc/rdoc/classes/RequestLog/Access.src/{M000122.html → M000134.html} +5 -5
- data/doc/rdoc/classes/RequestLog/Files.html +144 -0
- data/doc/rdoc/classes/RequestLog/Files.src/{M000123.html → M000135.html} +5 -5
- data/doc/rdoc/classes/RequestLog/Objects.html +144 -0
- data/doc/rdoc/classes/RequestLog/Objects.src/{M000124.html → M000137.html} +5 -5
- data/doc/rdoc/classes/RequestLog/Params.html +144 -0
- data/doc/rdoc/classes/RequestLog/Params.src/{M000125.html → M000138.html} +5 -5
- data/doc/rdoc/classes/RequestLog/Threads.html +144 -0
- data/doc/rdoc/classes/RequestLog/Threads.src/M000136.html +34 -0
- data/doc/rdoc/classes/Stats.html +54 -36
- data/doc/rdoc/classes/Stats.src/{M000013.html → M000005.html} +6 -5
- data/doc/rdoc/classes/Stats.src/M000006.html +23 -0
- data/doc/rdoc/classes/Stats.src/M000007.html +26 -0
- data/doc/rdoc/classes/Stats.src/M000008.html +18 -0
- data/doc/rdoc/classes/Stats.src/M000009.html +5 -6
- data/doc/rdoc/classes/Stats.src/M000010.html +5 -10
- data/doc/rdoc/classes/Stats.src/M000011.html +10 -13
- data/doc/rdoc/classes/Stats.src/M000012.html +7 -5
- data/doc/rdoc/classes/TCPServer.html +9 -9
- data/doc/rdoc/classes/TCPServer.src/M000003.html +19 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/COPYING.html +1 -1
- data/doc/rdoc/files/LICENSE.html +1 -1
- data/doc/rdoc/files/README.html +1 -1
- data/doc/rdoc/files/ext/http11/http11_c.html +1 -1
- data/doc/rdoc/files/lib/mongrel/camping_rb.html +28 -1
- data/doc/rdoc/files/lib/mongrel/cgi_rb.html +28 -1
- data/doc/rdoc/files/lib/mongrel/command_rb.html +28 -1
- data/doc/rdoc/files/lib/mongrel/debug_rb.html +28 -1
- data/doc/rdoc/files/lib/mongrel/handlers_rb.html +3 -3
- data/doc/rdoc/files/lib/mongrel/init_rb.html +28 -1
- data/doc/rdoc/files/lib/mongrel/rails_rb.html +28 -1
- data/doc/rdoc/files/lib/mongrel/stats_rb.html +21 -10
- data/doc/rdoc/files/lib/mongrel/tcphack_rb.html +23 -4
- data/doc/rdoc/files/lib/mongrel_rb.html +33 -1
- data/doc/rdoc/fr_class_index.html +65 -0
- data/doc/rdoc/fr_file_index.html +40 -0
- data/doc/rdoc/fr_method_index.html +164 -0
- data/doc/rdoc/index.html +24 -0
- data/examples/camping/blog.rb +1 -1
- data/examples/camping/tepee.rb +4 -3
- data/examples/simpletest.rb +15 -14
- data/ext/http11/http11.c +52 -18
- data/ext/http11/http11_parser.c +194 -177
- data/ext/http11/http11_parser.h +23 -5
- data/lib/mongrel.rb +295 -134
- data/lib/mongrel/camping.rb +48 -6
- data/lib/mongrel/cgi.rb +20 -2
- data/lib/mongrel/command.rb +76 -27
- data/lib/mongrel/debug.rb +42 -13
- data/lib/mongrel/handlers.rb +218 -59
- data/lib/mongrel/init.rb +18 -0
- data/lib/mongrel/rails.rb +61 -44
- data/lib/mongrel/stats.rb +30 -2
- data/lib/mongrel/tcphack.rb +18 -0
- data/setup.rb +799 -574
- data/test/mime.yaml +3 -0
- data/test/mongrel.conf +1 -0
- data/test/test_command.rb +101 -0
- data/test/test_conditional.rb +124 -0
- data/test/test_configurator.rb +56 -22
- data/test/test_debug.rb +18 -2
- data/test/test_handlers.rb +105 -0
- data/test/test_http11.rb +27 -9
- data/test/test_response.rb +38 -0
- data/test/test_stats.rb +21 -2
- data/test/test_uriclassifier.rb +18 -0
- data/test/test_ws.rb +105 -19
- data/test/testhelp.rb +36 -0
- data/tools/rakehelp.rb +52 -46
- data/tools/trickletest.rb +37 -0
- metadata +127 -76
- data/doc/rdoc/classes/Class.src/M000001.html +0 -24
- data/doc/rdoc/classes/Class.src/M000002.html +0 -62
- data/doc/rdoc/classes/Class.src/M000003.html +0 -21
- data/doc/rdoc/classes/Class.src/M000004.html +0 -20
- data/doc/rdoc/classes/Kernel.src/M000026.html +0 -25
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000090.html +0 -24
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000091.html +0 -47
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000092.html +0 -34
- data/doc/rdoc/classes/Mongrel/Camping.src/M000048.html +0 -22
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000050.html +0 -27
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000037.html +0 -18
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000038.html +0 -18
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000041.html +0 -46
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000099.html +0 -24
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000100.html +0 -23
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000102.html +0 -32
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000103.html +0 -19
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000104.html +0 -31
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000062.html +0 -40
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000063.html +0 -18
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000118.html +0 -28
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000075.html +0 -26
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000070.html +0 -22
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000071.html +0 -18
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000044.html +0 -32
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000046.html +0 -48
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000047.html +0 -23
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000085.html +0 -18
- data/doc/rdoc/classes/ObjectTracker.src/M000016.html +0 -22
- data/doc/rdoc/classes/ObjectTracker.src/M000017.html +0 -18
- data/doc/rdoc/classes/ObjectTracker.src/M000018.html +0 -18
- data/doc/rdoc/classes/ObjectTracker.src/M000019.html +0 -44
- data/doc/rdoc/classes/Stats.src/M000014.html +0 -19
- data/doc/rdoc/classes/Stats.src/M000015.html +0 -20
- data/doc/rdoc/classes/TCPServer.src/M000007.html +0 -19
- data/lib/mongrel/#rails.rb# +0 -178
data/doc/rdoc/index.html
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
|
5
|
+
|
|
6
|
+
<!--
|
|
7
|
+
|
|
8
|
+
RDoc Documentation
|
|
9
|
+
|
|
10
|
+
-->
|
|
11
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
12
|
+
<head>
|
|
13
|
+
<title>RDoc Documentation</title>
|
|
14
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
15
|
+
</head>
|
|
16
|
+
<frameset rows="20%, 80%">
|
|
17
|
+
<frameset cols="25%,35%,45%">
|
|
18
|
+
<frame src="fr_file_index.html" title="Files" name="Files" />
|
|
19
|
+
<frame src="fr_class_index.html" name="Classes" />
|
|
20
|
+
<frame src="fr_method_index.html" name="Methods" />
|
|
21
|
+
</frameset>
|
|
22
|
+
<frame src="files/README.html" name="docwin" />
|
|
23
|
+
</frameset>
|
|
24
|
+
</html>
|
data/examples/camping/blog.rb
CHANGED
|
@@ -281,7 +281,7 @@ if __FILE__ == $0
|
|
|
281
281
|
# Use the Configurator as an example rather than Mongrel::Camping.start
|
|
282
282
|
config = Mongrel::Configurator.new :host => "0.0.0.0" do
|
|
283
283
|
listener :port => 3002 do
|
|
284
|
-
uri "/blog", :handler => CampingHandler.new(Blog)
|
|
284
|
+
uri "/blog", :handler => Mongrel::Camping::CampingHandler.new(Blog)
|
|
285
285
|
uri "/favicon", :handler => Mongrel::Error404Handler.new("")
|
|
286
286
|
trap("INT") { stop }
|
|
287
287
|
run
|
data/examples/camping/tepee.rb
CHANGED
|
@@ -115,12 +115,13 @@ module Tepee::Views
|
|
|
115
115
|
def _markup body
|
|
116
116
|
return '' if body.blank?
|
|
117
117
|
body.gsub!(Tepee::Models::Page::PAGE_LINK) do
|
|
118
|
-
page = title = $1
|
|
118
|
+
page = title = $1
|
|
119
119
|
title = $2 unless $2.empty?
|
|
120
|
+
page = page.gsub /\W/, '_'
|
|
120
121
|
if Tepee::Models::Page.find(:all, :select => 'title').collect { |p| p.title }.include?(page)
|
|
121
|
-
%Q{<a href="#{R
|
|
122
|
+
%Q{<a href="#{self/R(Show, page)}">#{title}</a>}
|
|
122
123
|
else
|
|
123
|
-
%Q{<span>#{title}<a href="#{R
|
|
124
|
+
%Q{<span>#{title}<a href="#{self/R(Edit, page, 1)}">?</a></span>}
|
|
124
125
|
end
|
|
125
126
|
end
|
|
126
127
|
RedCloth.new(body, [ :hard_breaks ]).to_html
|
data/examples/simpletest.rb
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
|
+
$LOAD_PATH << File.join(File.dirname(__FILE__), "..", "lib")
|
|
1
2
|
require 'mongrel'
|
|
2
3
|
require 'yaml'
|
|
3
|
-
require 'zlib'
|
|
4
4
|
|
|
5
5
|
class SimpleHandler < Mongrel::HttpHandler
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
head["Content-Encoding"] = "deflate"
|
|
12
|
-
# send it back deflated
|
|
13
|
-
out << Zlib::Deflate.deflate(results)
|
|
14
|
-
else
|
|
15
|
-
# no gzip supported, send it back normal
|
|
16
|
-
out << results
|
|
17
|
-
end
|
|
18
|
-
end
|
|
6
|
+
def process(request, response)
|
|
7
|
+
response.start do |head,out|
|
|
8
|
+
head["Content-Type"] = "text/html"
|
|
9
|
+
results = "<html><body>Your request:<br /><pre>#{request.params.to_yaml}</pre><a href=\"/files\">View the files.</a></body></html>"
|
|
10
|
+
out << results
|
|
19
11
|
end
|
|
12
|
+
end
|
|
20
13
|
end
|
|
21
14
|
|
|
22
15
|
class DumbHandler < Mongrel::HttpHandler
|
|
@@ -34,11 +27,19 @@ if ARGV.length != 3
|
|
|
34
27
|
exit(1)
|
|
35
28
|
end
|
|
36
29
|
|
|
30
|
+
stats = Mongrel::StatisticsFilter.new(:sample_rate => 1)
|
|
31
|
+
|
|
37
32
|
config = Mongrel::Configurator.new :host => ARGV[0], :port => ARGV[1] do
|
|
38
33
|
listener do
|
|
39
34
|
uri "/", :handler => SimpleHandler.new
|
|
35
|
+
uri "/", :handler => Mongrel::DeflateFilter.new
|
|
36
|
+
uri "/", :handler => stats
|
|
40
37
|
uri "/dumb", :handler => DumbHandler.new
|
|
38
|
+
uri "/dumb", :handler => Mongrel::DeflateFilter.new
|
|
39
|
+
uri "/dumb", :handler => stats
|
|
41
40
|
uri "/files", :handler => Mongrel::DirHandler.new(ARGV[2])
|
|
41
|
+
uri "/files", :handler => stats
|
|
42
|
+
uri "/status", :handler => Mongrel::StatusHandler.new(:stats_filter => stats)
|
|
42
43
|
end
|
|
43
44
|
|
|
44
45
|
trap("INT") { stop }
|
data/ext/http11/http11.c
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/* Mongrel Web Server - A Mostly Ruby Webserver and Library
|
|
2
|
+
*
|
|
3
|
+
* Copyright (C) 2005 Zed A. Shaw zedshaw AT zedshaw dot com
|
|
4
|
+
*
|
|
5
|
+
* This library is free software; you can redistribute it and/or
|
|
6
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
7
|
+
* License as published by the Free Software Foundation; either
|
|
8
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This library is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
13
|
+
* Lesser General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
16
|
+
* License along with this library; if not, write to the Free Software
|
|
17
|
+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
18
|
+
*/
|
|
19
|
+
|
|
1
20
|
#include "ruby.h"
|
|
2
21
|
#include "ext_help.h"
|
|
3
22
|
#include <assert.h>
|
|
@@ -23,7 +42,6 @@ static VALUE global_content_type;
|
|
|
23
42
|
static VALUE global_http_content_type;
|
|
24
43
|
static VALUE global_gateway_interface;
|
|
25
44
|
static VALUE global_gateway_interface_value;
|
|
26
|
-
static VALUE global_interface_value;
|
|
27
45
|
static VALUE global_server_name;
|
|
28
46
|
static VALUE global_server_port;
|
|
29
47
|
static VALUE global_server_protocol;
|
|
@@ -33,6 +51,8 @@ static VALUE global_mongrel_version;
|
|
|
33
51
|
static VALUE global_server_software;
|
|
34
52
|
static VALUE global_port_80;
|
|
35
53
|
|
|
54
|
+
#define TRIE_INCREASE 30
|
|
55
|
+
|
|
36
56
|
/** Defines common length and error messages for input length validation. */
|
|
37
57
|
#define DEF_MAX_LENGTH(N,length) const size_t MAX_##N##_LENGTH = length; const char *MAX_##N##_LENGTH_ERR = "HTTP element " # N " is longer than the " # length " allowed length.";
|
|
38
58
|
|
|
@@ -64,7 +84,7 @@ void http_field(void *data, const char *field, size_t flen, const char *value, s
|
|
|
64
84
|
v = rb_str_new(value, vlen);
|
|
65
85
|
f = rb_str_dup(global_http_prefix);
|
|
66
86
|
f = rb_str_buf_cat(f, field, flen);
|
|
67
|
-
|
|
87
|
+
|
|
68
88
|
for(ch = RSTRING(f)->ptr, end = ch + RSTRING(f)->len; ch < end; ch++) {
|
|
69
89
|
if(*ch == '-') {
|
|
70
90
|
*ch = '_';
|
|
@@ -101,7 +121,7 @@ void query_string(void *data, const char *at, size_t length)
|
|
|
101
121
|
{
|
|
102
122
|
VALUE req = (VALUE)data;
|
|
103
123
|
VALUE val = Qnil;
|
|
104
|
-
|
|
124
|
+
|
|
105
125
|
VALIDATE_MAX_LENGTH(length, QUERY_STRING);
|
|
106
126
|
|
|
107
127
|
val = rb_str_new(at, length);
|
|
@@ -122,8 +142,6 @@ void header_done(void *data, const char *at, size_t length)
|
|
|
122
142
|
{
|
|
123
143
|
VALUE req = (VALUE)data;
|
|
124
144
|
VALUE temp = Qnil;
|
|
125
|
-
VALUE host = Qnil;
|
|
126
|
-
VALUE port = Qnil;
|
|
127
145
|
VALUE ctype = Qnil;
|
|
128
146
|
VALUE clen = Qnil;
|
|
129
147
|
char *colon = NULL;
|
|
@@ -238,7 +256,7 @@ VALUE HttpParser_finish(VALUE self)
|
|
|
238
256
|
|
|
239
257
|
/**
|
|
240
258
|
* call-seq:
|
|
241
|
-
* parser.execute(req_hash, data) -> Integer
|
|
259
|
+
* parser.execute(req_hash, data, start) -> Integer
|
|
242
260
|
*
|
|
243
261
|
* Takes a Hash and a String of data, parses the String of data filling in the Hash
|
|
244
262
|
* returning an Integer to indicate how much of the data has been read. No matter
|
|
@@ -248,25 +266,42 @@ VALUE HttpParser_finish(VALUE self)
|
|
|
248
266
|
* This function now throws an exception when there is a parsing error. This makes
|
|
249
267
|
* the logic for working with the parser much easier. You can still test for an
|
|
250
268
|
* error, but now you need to wrap the parser with an exception handling block.
|
|
269
|
+
*
|
|
270
|
+
* The third argument allows for parsing a partial request and then continuing
|
|
271
|
+
* the parsing from that position. It needs all of the original data as well
|
|
272
|
+
* so you have to append to the data buffer as you read.
|
|
251
273
|
*/
|
|
252
|
-
VALUE HttpParser_execute(VALUE self, VALUE req_hash, VALUE data)
|
|
274
|
+
VALUE HttpParser_execute(VALUE self, VALUE req_hash, VALUE data, VALUE start)
|
|
253
275
|
{
|
|
254
276
|
http_parser *http = NULL;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
http_parser_execute(http, RSTRING(data)->ptr, RSTRING(data)->len);
|
|
277
|
+
int from = 0;
|
|
278
|
+
char *dptr = NULL;
|
|
279
|
+
long dlen = 0;
|
|
259
280
|
|
|
260
|
-
|
|
281
|
+
DATA_GET(self, http_parser, http);
|
|
261
282
|
|
|
262
|
-
|
|
263
|
-
|
|
283
|
+
from = FIX2INT(start);
|
|
284
|
+
dptr = RSTRING(data)->ptr;
|
|
285
|
+
dlen = RSTRING(data)->len;
|
|
286
|
+
|
|
287
|
+
if(from >= dlen) {
|
|
288
|
+
rb_raise(eHttpParserError, "Requested start is after data buffer end.");
|
|
264
289
|
} else {
|
|
265
|
-
|
|
290
|
+
http->data = (void *)req_hash;
|
|
291
|
+
http_parser_execute(http, dptr, dlen, from);
|
|
292
|
+
|
|
293
|
+
VALIDATE_MAX_LENGTH(http_parser_nread(http), HEADER);
|
|
294
|
+
|
|
295
|
+
if(http_parser_has_error(http)) {
|
|
296
|
+
rb_raise(eHttpParserError, "Invalid HTTP format, parsing fails.");
|
|
297
|
+
} else {
|
|
298
|
+
return INT2FIX(http_parser_nread(http));
|
|
299
|
+
}
|
|
266
300
|
}
|
|
267
301
|
}
|
|
268
302
|
|
|
269
303
|
|
|
304
|
+
|
|
270
305
|
/**
|
|
271
306
|
* call-seq:
|
|
272
307
|
* parser.error? -> true/false
|
|
@@ -323,7 +358,6 @@ void URIClassifier_free(void *data)
|
|
|
323
358
|
}
|
|
324
359
|
|
|
325
360
|
|
|
326
|
-
#define TRIE_INCREASE 30
|
|
327
361
|
|
|
328
362
|
VALUE URIClassifier_alloc(VALUE klass)
|
|
329
363
|
{
|
|
@@ -520,7 +554,7 @@ void Init_http11()
|
|
|
520
554
|
DEF_GLOBAL(server_protocol, "SERVER_PROTOCOL");
|
|
521
555
|
DEF_GLOBAL(server_protocol_value, "HTTP/1.1");
|
|
522
556
|
DEF_GLOBAL(http_host, "HTTP_HOST");
|
|
523
|
-
DEF_GLOBAL(mongrel_version, "Mongrel 0.3.
|
|
557
|
+
DEF_GLOBAL(mongrel_version, "Mongrel 0.3.13");
|
|
524
558
|
DEF_GLOBAL(server_software, "SERVER_SOFTWARE");
|
|
525
559
|
DEF_GLOBAL(port_80, "80");
|
|
526
560
|
|
|
@@ -531,7 +565,7 @@ void Init_http11()
|
|
|
531
565
|
rb_define_method(cHttpParser, "initialize", HttpParser_init,0);
|
|
532
566
|
rb_define_method(cHttpParser, "reset", HttpParser_reset,0);
|
|
533
567
|
rb_define_method(cHttpParser, "finish", HttpParser_finish,0);
|
|
534
|
-
rb_define_method(cHttpParser, "execute", HttpParser_execute,
|
|
568
|
+
rb_define_method(cHttpParser, "execute", HttpParser_execute,3);
|
|
535
569
|
rb_define_method(cHttpParser, "error?", HttpParser_has_error,0);
|
|
536
570
|
rb_define_method(cHttpParser, "finished?", HttpParser_is_finished,0);
|
|
537
571
|
rb_define_method(cHttpParser, "nread", HttpParser_nread,0);
|
data/ext/http11/http11_parser.c
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
#line 1 "ext/http11/http11_parser.rl"
|
|
2
|
+
/* Mongrel Web Server - A Mostly Ruby Webserver and Library
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2005 Zed A. Shaw zedshaw AT zedshaw dot com
|
|
5
|
+
*
|
|
6
|
+
* This library is free software; you can redistribute it and/or
|
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
8
|
+
* License as published by the Free Software Foundation; either
|
|
9
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* This library is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
+
* Lesser General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
17
|
+
* License along with this library; if not, write to the Free Software
|
|
18
|
+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
19
|
+
*/
|
|
20
|
+
|
|
2
21
|
#include "http11_parser.h"
|
|
3
22
|
#include <stdio.h>
|
|
4
23
|
#include <assert.h>
|
|
@@ -6,51 +25,61 @@
|
|
|
6
25
|
#include <ctype.h>
|
|
7
26
|
#include <string.h>
|
|
8
27
|
|
|
9
|
-
#define
|
|
28
|
+
#define LEN(AT, FPC) (FPC - buffer - parser->AT)
|
|
29
|
+
#define MARK(M,FPC) (parser->M = (FPC) - buffer)
|
|
30
|
+
#define PTR_TO(F) (buffer + parser->F)
|
|
10
31
|
|
|
11
32
|
/** machine **/
|
|
12
|
-
#line
|
|
33
|
+
#line 121 "ext/http11/http11_parser.rl"
|
|
13
34
|
|
|
14
35
|
|
|
15
36
|
/** Data **/
|
|
16
37
|
|
|
17
|
-
#line
|
|
38
|
+
#line 39 "ext/http11/http11_parser.c"
|
|
18
39
|
static int http_parser_start = 0;
|
|
19
40
|
|
|
20
41
|
static int http_parser_first_final = 51;
|
|
21
42
|
|
|
22
43
|
static int http_parser_error = 1;
|
|
23
44
|
|
|
24
|
-
#line
|
|
45
|
+
#line 125 "ext/http11/http11_parser.rl"
|
|
25
46
|
|
|
26
47
|
int http_parser_init(http_parser *parser) {
|
|
27
48
|
int cs = 0;
|
|
28
49
|
|
|
29
|
-
#line
|
|
50
|
+
#line 51 "ext/http11/http11_parser.c"
|
|
30
51
|
{
|
|
31
52
|
cs = http_parser_start;
|
|
32
53
|
}
|
|
33
|
-
#line
|
|
54
|
+
#line 129 "ext/http11/http11_parser.rl"
|
|
34
55
|
parser->cs = cs;
|
|
35
|
-
parser->body_start =
|
|
56
|
+
parser->body_start = 0;
|
|
36
57
|
parser->content_len = 0;
|
|
37
|
-
parser->mark =
|
|
58
|
+
parser->mark = 0;
|
|
38
59
|
parser->nread = 0;
|
|
60
|
+
parser->field_len = 0;
|
|
61
|
+
parser->field_start = 0;
|
|
39
62
|
|
|
40
63
|
return(1);
|
|
41
64
|
}
|
|
42
65
|
|
|
43
66
|
|
|
44
67
|
/** exec **/
|
|
45
|
-
size_t http_parser_execute(http_parser *parser, const char *buffer, size_t len) {
|
|
68
|
+
size_t http_parser_execute(http_parser *parser, const char *buffer, size_t len, size_t off) {
|
|
46
69
|
const char *p, *pe;
|
|
47
70
|
int cs = parser->cs;
|
|
48
71
|
|
|
49
|
-
|
|
72
|
+
assert(off <= len && "offset past end of buffer");
|
|
73
|
+
|
|
74
|
+
p = buffer+off;
|
|
50
75
|
pe = buffer+len;
|
|
51
76
|
|
|
77
|
+
assert(*pe == '\0' && "pointer does not end on NUL");
|
|
78
|
+
assert(pe - p == len - off && "pointers aren't same distance");
|
|
79
|
+
|
|
80
|
+
|
|
52
81
|
|
|
53
|
-
#line
|
|
82
|
+
#line 83 "ext/http11/http11_parser.c"
|
|
54
83
|
{
|
|
55
84
|
p -= 1;
|
|
56
85
|
if ( ++p == pe )
|
|
@@ -74,16 +103,16 @@ case 0:
|
|
|
74
103
|
st1:
|
|
75
104
|
goto _out1;
|
|
76
105
|
tr14:
|
|
77
|
-
#line
|
|
78
|
-
{MARK(
|
|
106
|
+
#line 35 "ext/http11/http11_parser.rl"
|
|
107
|
+
{MARK(mark, p); }
|
|
79
108
|
goto st2;
|
|
80
109
|
st2:
|
|
81
110
|
if ( ++p == pe )
|
|
82
111
|
goto _out2;
|
|
83
112
|
case 2:
|
|
84
|
-
#line
|
|
113
|
+
#line 114 "ext/http11/http11_parser.c"
|
|
85
114
|
switch( (*p) ) {
|
|
86
|
-
case 32: goto
|
|
115
|
+
case 32: goto tr18;
|
|
87
116
|
case 36: goto st32;
|
|
88
117
|
case 95: goto st32;
|
|
89
118
|
}
|
|
@@ -96,19 +125,18 @@ case 2:
|
|
|
96
125
|
} else
|
|
97
126
|
goto st32;
|
|
98
127
|
goto st1;
|
|
99
|
-
|
|
100
|
-
#line
|
|
128
|
+
tr18:
|
|
129
|
+
#line 48 "ext/http11/http11_parser.rl"
|
|
101
130
|
{
|
|
102
|
-
assert(p - parser->mark >= 0 && "buffer overflow");
|
|
103
131
|
if(parser->request_method != NULL)
|
|
104
|
-
parser->request_method(parser->data,
|
|
132
|
+
parser->request_method(parser->data, PTR_TO(mark), LEN(mark, p));
|
|
105
133
|
}
|
|
106
134
|
goto st3;
|
|
107
135
|
st3:
|
|
108
136
|
if ( ++p == pe )
|
|
109
137
|
goto _out3;
|
|
110
138
|
case 3:
|
|
111
|
-
#line
|
|
139
|
+
#line 140 "ext/http11/http11_parser.c"
|
|
112
140
|
switch( (*p) ) {
|
|
113
141
|
case 42: goto tr10;
|
|
114
142
|
case 43: goto tr11;
|
|
@@ -125,50 +153,48 @@ case 3:
|
|
|
125
153
|
goto tr11;
|
|
126
154
|
goto st1;
|
|
127
155
|
tr10:
|
|
128
|
-
#line
|
|
129
|
-
{MARK(
|
|
156
|
+
#line 35 "ext/http11/http11_parser.rl"
|
|
157
|
+
{MARK(mark, p); }
|
|
130
158
|
goto st4;
|
|
131
159
|
st4:
|
|
132
160
|
if ( ++p == pe )
|
|
133
161
|
goto _out4;
|
|
134
162
|
case 4:
|
|
135
|
-
#line
|
|
163
|
+
#line 164 "ext/http11/http11_parser.c"
|
|
136
164
|
if ( (*p) == 32 )
|
|
137
|
-
goto
|
|
165
|
+
goto tr20;
|
|
138
166
|
goto st1;
|
|
139
|
-
|
|
140
|
-
#line
|
|
167
|
+
tr20:
|
|
168
|
+
#line 52 "ext/http11/http11_parser.rl"
|
|
141
169
|
{
|
|
142
|
-
assert(p - parser->mark >= 0 && "buffer overflow");
|
|
143
170
|
if(parser->request_uri != NULL)
|
|
144
|
-
parser->request_uri(parser->data,
|
|
171
|
+
parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
|
|
145
172
|
}
|
|
146
173
|
goto st5;
|
|
147
|
-
|
|
148
|
-
#line
|
|
174
|
+
tr32:
|
|
175
|
+
#line 56 "ext/http11/http11_parser.rl"
|
|
149
176
|
{
|
|
150
|
-
assert(p - parser->mark >= 0 && "buffer overflow");
|
|
151
177
|
if(parser->query_string != NULL)
|
|
152
|
-
parser->query_string(parser->data,
|
|
178
|
+
parser->query_string(parser->data, PTR_TO(mark), LEN(mark, p));
|
|
153
179
|
}
|
|
154
180
|
goto st5;
|
|
155
181
|
st5:
|
|
156
182
|
if ( ++p == pe )
|
|
157
183
|
goto _out5;
|
|
158
184
|
case 5:
|
|
159
|
-
#line
|
|
185
|
+
#line 186 "ext/http11/http11_parser.c"
|
|
160
186
|
if ( (*p) == 72 )
|
|
161
187
|
goto tr3;
|
|
162
188
|
goto st1;
|
|
163
189
|
tr3:
|
|
164
|
-
#line
|
|
165
|
-
{MARK(
|
|
190
|
+
#line 35 "ext/http11/http11_parser.rl"
|
|
191
|
+
{MARK(mark, p); }
|
|
166
192
|
goto st6;
|
|
167
193
|
st6:
|
|
168
194
|
if ( ++p == pe )
|
|
169
195
|
goto _out6;
|
|
170
196
|
case 6:
|
|
171
|
-
#line
|
|
197
|
+
#line 198 "ext/http11/http11_parser.c"
|
|
172
198
|
if ( (*p) == 84 )
|
|
173
199
|
goto st7;
|
|
174
200
|
goto st1;
|
|
@@ -221,26 +247,22 @@ st13:
|
|
|
221
247
|
goto _out13;
|
|
222
248
|
case 13:
|
|
223
249
|
if ( (*p) == 13 )
|
|
224
|
-
goto
|
|
250
|
+
goto tr23;
|
|
225
251
|
if ( 48 <= (*p) && (*p) <= 57 )
|
|
226
252
|
goto st13;
|
|
227
253
|
goto st1;
|
|
228
|
-
|
|
229
|
-
#line
|
|
254
|
+
tr23:
|
|
255
|
+
#line 61 "ext/http11/http11_parser.rl"
|
|
230
256
|
{
|
|
231
|
-
assert(p - parser->mark >= 0 && "buffer overflow");
|
|
232
257
|
if(parser->http_version != NULL)
|
|
233
|
-
parser->http_version(parser->data,
|
|
258
|
+
parser->http_version(parser->data, PTR_TO(mark), LEN(mark, p));
|
|
234
259
|
}
|
|
235
260
|
goto st14;
|
|
236
|
-
|
|
237
|
-
#line
|
|
261
|
+
tr35:
|
|
262
|
+
#line 43 "ext/http11/http11_parser.rl"
|
|
238
263
|
{
|
|
239
|
-
assert(p - (parser->mark - 1) >= 0 && "buffer overflow");
|
|
240
264
|
if(parser->http_field != NULL) {
|
|
241
|
-
parser->http_field(parser->data,
|
|
242
|
-
parser->field_start, parser->field_len,
|
|
243
|
-
parser->mark+1, p - (parser->mark +1));
|
|
265
|
+
parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
|
|
244
266
|
}
|
|
245
267
|
}
|
|
246
268
|
goto st14;
|
|
@@ -248,7 +270,7 @@ st14:
|
|
|
248
270
|
if ( ++p == pe )
|
|
249
271
|
goto _out14;
|
|
250
272
|
case 14:
|
|
251
|
-
#line
|
|
273
|
+
#line 274 "ext/http11/http11_parser.c"
|
|
252
274
|
if ( (*p) == 10 )
|
|
253
275
|
goto st15;
|
|
254
276
|
goto st1;
|
|
@@ -258,39 +280,39 @@ st15:
|
|
|
258
280
|
case 15:
|
|
259
281
|
switch( (*p) ) {
|
|
260
282
|
case 13: goto st16;
|
|
261
|
-
case 33: goto
|
|
262
|
-
case 124: goto
|
|
263
|
-
case 126: goto
|
|
283
|
+
case 33: goto tr22;
|
|
284
|
+
case 124: goto tr22;
|
|
285
|
+
case 126: goto tr22;
|
|
264
286
|
}
|
|
265
287
|
if ( (*p) < 45 ) {
|
|
266
288
|
if ( (*p) > 39 ) {
|
|
267
289
|
if ( 42 <= (*p) && (*p) <= 43 )
|
|
268
|
-
goto
|
|
290
|
+
goto tr22;
|
|
269
291
|
} else if ( (*p) >= 35 )
|
|
270
|
-
goto
|
|
292
|
+
goto tr22;
|
|
271
293
|
} else if ( (*p) > 46 ) {
|
|
272
294
|
if ( (*p) < 65 ) {
|
|
273
295
|
if ( 48 <= (*p) && (*p) <= 57 )
|
|
274
|
-
goto
|
|
296
|
+
goto tr22;
|
|
275
297
|
} else if ( (*p) > 90 ) {
|
|
276
298
|
if ( 94 <= (*p) && (*p) <= 122 )
|
|
277
|
-
goto
|
|
299
|
+
goto tr22;
|
|
278
300
|
} else
|
|
279
|
-
goto
|
|
301
|
+
goto tr22;
|
|
280
302
|
} else
|
|
281
|
-
goto
|
|
303
|
+
goto tr22;
|
|
282
304
|
goto st1;
|
|
283
305
|
st16:
|
|
284
306
|
if ( ++p == pe )
|
|
285
307
|
goto _out16;
|
|
286
308
|
case 16:
|
|
287
309
|
if ( (*p) == 10 )
|
|
288
|
-
goto
|
|
310
|
+
goto tr26;
|
|
289
311
|
goto st1;
|
|
290
|
-
|
|
291
|
-
#line
|
|
312
|
+
tr26:
|
|
313
|
+
#line 66 "ext/http11/http11_parser.rl"
|
|
292
314
|
{
|
|
293
|
-
parser->body_start = p+1;
|
|
315
|
+
parser->body_start = p - buffer + 1;
|
|
294
316
|
if(parser->header_done != NULL)
|
|
295
317
|
parser->header_done(parser->data, p, 0);
|
|
296
318
|
goto _out51;
|
|
@@ -300,17 +322,17 @@ st51:
|
|
|
300
322
|
if ( ++p == pe )
|
|
301
323
|
goto _out51;
|
|
302
324
|
case 51:
|
|
303
|
-
#line
|
|
325
|
+
#line 326 "ext/http11/http11_parser.c"
|
|
304
326
|
goto st1;
|
|
305
|
-
|
|
306
|
-
#line
|
|
307
|
-
{
|
|
327
|
+
tr22:
|
|
328
|
+
#line 37 "ext/http11/http11_parser.rl"
|
|
329
|
+
{ MARK(field_start, p); }
|
|
308
330
|
goto st17;
|
|
309
331
|
st17:
|
|
310
332
|
if ( ++p == pe )
|
|
311
333
|
goto _out17;
|
|
312
334
|
case 17:
|
|
313
|
-
#line
|
|
335
|
+
#line 336 "ext/http11/http11_parser.c"
|
|
314
336
|
switch( (*p) ) {
|
|
315
337
|
case 33: goto st17;
|
|
316
338
|
case 58: goto tr16;
|
|
@@ -336,68 +358,75 @@ case 17:
|
|
|
336
358
|
goto st17;
|
|
337
359
|
goto st1;
|
|
338
360
|
tr16:
|
|
339
|
-
#line
|
|
361
|
+
#line 38 "ext/http11/http11_parser.rl"
|
|
340
362
|
{
|
|
341
|
-
parser->field_len = (p
|
|
363
|
+
parser->field_len = LEN(field_start, p);
|
|
342
364
|
}
|
|
343
365
|
goto st18;
|
|
344
366
|
st18:
|
|
345
367
|
if ( ++p == pe )
|
|
346
368
|
goto _out18;
|
|
347
369
|
case 18:
|
|
348
|
-
#line
|
|
349
|
-
if ( (*p) ==
|
|
350
|
-
goto
|
|
351
|
-
goto
|
|
352
|
-
tr37:
|
|
353
|
-
#line 21 "ext/http11/http11_parser.rl"
|
|
354
|
-
{ MARK(parser, p); }
|
|
355
|
-
goto st19;
|
|
370
|
+
#line 371 "ext/http11/http11_parser.c"
|
|
371
|
+
if ( (*p) == 32 )
|
|
372
|
+
goto st19;
|
|
373
|
+
goto st1;
|
|
356
374
|
st19:
|
|
357
375
|
if ( ++p == pe )
|
|
358
376
|
goto _out19;
|
|
359
377
|
case 19:
|
|
360
|
-
#line 361 "ext/http11/http11_parser.c"
|
|
361
378
|
if ( (*p) == 13 )
|
|
362
|
-
goto
|
|
363
|
-
goto
|
|
364
|
-
|
|
365
|
-
#line
|
|
366
|
-
{MARK(
|
|
379
|
+
goto tr35;
|
|
380
|
+
goto tr38;
|
|
381
|
+
tr38:
|
|
382
|
+
#line 42 "ext/http11/http11_parser.rl"
|
|
383
|
+
{ MARK(mark, p); }
|
|
367
384
|
goto st20;
|
|
368
385
|
st20:
|
|
369
386
|
if ( ++p == pe )
|
|
370
387
|
goto _out20;
|
|
371
388
|
case 20:
|
|
372
|
-
#line
|
|
389
|
+
#line 390 "ext/http11/http11_parser.c"
|
|
390
|
+
if ( (*p) == 13 )
|
|
391
|
+
goto tr35;
|
|
392
|
+
goto st20;
|
|
393
|
+
tr11:
|
|
394
|
+
#line 35 "ext/http11/http11_parser.rl"
|
|
395
|
+
{MARK(mark, p); }
|
|
396
|
+
goto st21;
|
|
397
|
+
st21:
|
|
398
|
+
if ( ++p == pe )
|
|
399
|
+
goto _out21;
|
|
400
|
+
case 21:
|
|
401
|
+
#line 402 "ext/http11/http11_parser.c"
|
|
373
402
|
switch( (*p) ) {
|
|
374
|
-
case 43: goto
|
|
375
|
-
case 58: goto
|
|
403
|
+
case 43: goto st21;
|
|
404
|
+
case 58: goto st22;
|
|
376
405
|
}
|
|
377
406
|
if ( (*p) < 48 ) {
|
|
378
407
|
if ( 45 <= (*p) && (*p) <= 46 )
|
|
379
|
-
goto
|
|
408
|
+
goto st21;
|
|
380
409
|
} else if ( (*p) > 57 ) {
|
|
381
410
|
if ( (*p) > 90 ) {
|
|
382
411
|
if ( 97 <= (*p) && (*p) <= 122 )
|
|
383
|
-
goto
|
|
412
|
+
goto st21;
|
|
384
413
|
} else if ( (*p) >= 65 )
|
|
385
|
-
goto
|
|
414
|
+
goto st21;
|
|
386
415
|
} else
|
|
387
|
-
goto
|
|
416
|
+
goto st21;
|
|
388
417
|
goto st1;
|
|
389
418
|
tr13:
|
|
390
|
-
#line
|
|
391
|
-
{MARK(
|
|
392
|
-
goto
|
|
393
|
-
|
|
419
|
+
#line 35 "ext/http11/http11_parser.rl"
|
|
420
|
+
{MARK(mark, p); }
|
|
421
|
+
goto st22;
|
|
422
|
+
st22:
|
|
394
423
|
if ( ++p == pe )
|
|
395
|
-
goto
|
|
396
|
-
case
|
|
397
|
-
#line
|
|
424
|
+
goto _out22;
|
|
425
|
+
case 22:
|
|
426
|
+
#line 427 "ext/http11/http11_parser.c"
|
|
398
427
|
switch( (*p) ) {
|
|
399
|
-
case 32: goto
|
|
400
|
-
case 37: goto
|
|
428
|
+
case 32: goto tr20;
|
|
429
|
+
case 37: goto st23;
|
|
401
430
|
case 60: goto st1;
|
|
402
431
|
case 62: goto st1;
|
|
403
432
|
case 127: goto st1;
|
|
@@ -407,67 +436,48 @@ case 21:
|
|
|
407
436
|
goto st1;
|
|
408
437
|
} else if ( (*p) >= 0 )
|
|
409
438
|
goto st1;
|
|
410
|
-
goto
|
|
411
|
-
|
|
439
|
+
goto st22;
|
|
440
|
+
st23:
|
|
412
441
|
if ( ++p == pe )
|
|
413
|
-
goto
|
|
414
|
-
case
|
|
442
|
+
goto _out23;
|
|
443
|
+
case 23:
|
|
415
444
|
if ( (*p) < 65 ) {
|
|
416
445
|
if ( 48 <= (*p) && (*p) <= 57 )
|
|
417
|
-
goto
|
|
446
|
+
goto st24;
|
|
418
447
|
} else if ( (*p) > 70 ) {
|
|
419
448
|
if ( 97 <= (*p) && (*p) <= 102 )
|
|
420
|
-
goto
|
|
449
|
+
goto st24;
|
|
421
450
|
} else
|
|
422
|
-
goto
|
|
451
|
+
goto st24;
|
|
423
452
|
goto st1;
|
|
424
|
-
|
|
453
|
+
st24:
|
|
425
454
|
if ( ++p == pe )
|
|
426
|
-
goto
|
|
427
|
-
case
|
|
455
|
+
goto _out24;
|
|
456
|
+
case 24:
|
|
428
457
|
if ( (*p) < 65 ) {
|
|
429
458
|
if ( 48 <= (*p) && (*p) <= 57 )
|
|
430
|
-
goto
|
|
459
|
+
goto st22;
|
|
431
460
|
} else if ( (*p) > 70 ) {
|
|
432
461
|
if ( 97 <= (*p) && (*p) <= 102 )
|
|
433
|
-
goto
|
|
462
|
+
goto st22;
|
|
434
463
|
} else
|
|
435
|
-
goto
|
|
464
|
+
goto st22;
|
|
436
465
|
goto st1;
|
|
437
466
|
tr12:
|
|
438
|
-
#line
|
|
439
|
-
{MARK(
|
|
440
|
-
goto st24;
|
|
441
|
-
st24:
|
|
442
|
-
if ( ++p == pe )
|
|
443
|
-
goto _out24;
|
|
444
|
-
case 24:
|
|
445
|
-
#line 446 "ext/http11/http11_parser.c"
|
|
446
|
-
switch( (*p) ) {
|
|
447
|
-
case 32: goto tr19;
|
|
448
|
-
case 37: goto st26;
|
|
449
|
-
case 47: goto st1;
|
|
450
|
-
case 60: goto st1;
|
|
451
|
-
case 62: goto st1;
|
|
452
|
-
case 63: goto tr28;
|
|
453
|
-
case 127: goto st1;
|
|
454
|
-
}
|
|
455
|
-
if ( (*p) > 31 ) {
|
|
456
|
-
if ( 34 <= (*p) && (*p) <= 35 )
|
|
457
|
-
goto st1;
|
|
458
|
-
} else if ( (*p) >= 0 )
|
|
459
|
-
goto st1;
|
|
467
|
+
#line 35 "ext/http11/http11_parser.rl"
|
|
468
|
+
{MARK(mark, p); }
|
|
460
469
|
goto st25;
|
|
461
470
|
st25:
|
|
462
471
|
if ( ++p == pe )
|
|
463
472
|
goto _out25;
|
|
464
473
|
case 25:
|
|
474
|
+
#line 475 "ext/http11/http11_parser.c"
|
|
465
475
|
switch( (*p) ) {
|
|
466
|
-
case 32: goto
|
|
476
|
+
case 32: goto tr20;
|
|
467
477
|
case 37: goto st26;
|
|
468
478
|
case 60: goto st1;
|
|
469
479
|
case 62: goto st1;
|
|
470
|
-
case 63: goto
|
|
480
|
+
case 63: goto tr30;
|
|
471
481
|
case 127: goto st1;
|
|
472
482
|
}
|
|
473
483
|
if ( (*p) > 31 ) {
|
|
@@ -502,22 +512,21 @@ case 27:
|
|
|
502
512
|
} else
|
|
503
513
|
goto st25;
|
|
504
514
|
goto st1;
|
|
505
|
-
|
|
506
|
-
#line
|
|
515
|
+
tr30:
|
|
516
|
+
#line 52 "ext/http11/http11_parser.rl"
|
|
507
517
|
{
|
|
508
|
-
assert(p - parser->mark >= 0 && "buffer overflow");
|
|
509
518
|
if(parser->request_uri != NULL)
|
|
510
|
-
parser->request_uri(parser->data,
|
|
519
|
+
parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
|
|
511
520
|
}
|
|
512
521
|
goto st28;
|
|
513
522
|
st28:
|
|
514
523
|
if ( ++p == pe )
|
|
515
524
|
goto _out28;
|
|
516
525
|
case 28:
|
|
517
|
-
#line
|
|
526
|
+
#line 527 "ext/http11/http11_parser.c"
|
|
518
527
|
switch( (*p) ) {
|
|
519
|
-
case 32: goto
|
|
520
|
-
case 37: goto
|
|
528
|
+
case 32: goto tr32;
|
|
529
|
+
case 37: goto tr37;
|
|
521
530
|
case 60: goto st1;
|
|
522
531
|
case 62: goto st1;
|
|
523
532
|
case 127: goto st1;
|
|
@@ -527,18 +536,18 @@ case 28:
|
|
|
527
536
|
goto st1;
|
|
528
537
|
} else if ( (*p) >= 0 )
|
|
529
538
|
goto st1;
|
|
530
|
-
goto
|
|
531
|
-
|
|
532
|
-
#line
|
|
533
|
-
{MARK(
|
|
539
|
+
goto tr36;
|
|
540
|
+
tr36:
|
|
541
|
+
#line 35 "ext/http11/http11_parser.rl"
|
|
542
|
+
{MARK(mark, p); }
|
|
534
543
|
goto st29;
|
|
535
544
|
st29:
|
|
536
545
|
if ( ++p == pe )
|
|
537
546
|
goto _out29;
|
|
538
547
|
case 29:
|
|
539
|
-
#line
|
|
548
|
+
#line 549 "ext/http11/http11_parser.c"
|
|
540
549
|
switch( (*p) ) {
|
|
541
|
-
case 32: goto
|
|
550
|
+
case 32: goto tr32;
|
|
542
551
|
case 37: goto st30;
|
|
543
552
|
case 60: goto st1;
|
|
544
553
|
case 62: goto st1;
|
|
@@ -550,15 +559,15 @@ case 29:
|
|
|
550
559
|
} else if ( (*p) >= 0 )
|
|
551
560
|
goto st1;
|
|
552
561
|
goto st29;
|
|
553
|
-
|
|
554
|
-
#line
|
|
555
|
-
{MARK(
|
|
562
|
+
tr37:
|
|
563
|
+
#line 35 "ext/http11/http11_parser.rl"
|
|
564
|
+
{MARK(mark, p); }
|
|
556
565
|
goto st30;
|
|
557
566
|
st30:
|
|
558
567
|
if ( ++p == pe )
|
|
559
568
|
goto _out30;
|
|
560
569
|
case 30:
|
|
561
|
-
#line
|
|
570
|
+
#line 571 "ext/http11/http11_parser.c"
|
|
562
571
|
if ( (*p) < 65 ) {
|
|
563
572
|
if ( 48 <= (*p) && (*p) <= 57 )
|
|
564
573
|
goto st31;
|
|
@@ -586,7 +595,7 @@ st32:
|
|
|
586
595
|
goto _out32;
|
|
587
596
|
case 32:
|
|
588
597
|
switch( (*p) ) {
|
|
589
|
-
case 32: goto
|
|
598
|
+
case 32: goto tr18;
|
|
590
599
|
case 36: goto st33;
|
|
591
600
|
case 95: goto st33;
|
|
592
601
|
}
|
|
@@ -604,7 +613,7 @@ st33:
|
|
|
604
613
|
goto _out33;
|
|
605
614
|
case 33:
|
|
606
615
|
switch( (*p) ) {
|
|
607
|
-
case 32: goto
|
|
616
|
+
case 32: goto tr18;
|
|
608
617
|
case 36: goto st34;
|
|
609
618
|
case 95: goto st34;
|
|
610
619
|
}
|
|
@@ -622,7 +631,7 @@ st34:
|
|
|
622
631
|
goto _out34;
|
|
623
632
|
case 34:
|
|
624
633
|
switch( (*p) ) {
|
|
625
|
-
case 32: goto
|
|
634
|
+
case 32: goto tr18;
|
|
626
635
|
case 36: goto st35;
|
|
627
636
|
case 95: goto st35;
|
|
628
637
|
}
|
|
@@ -640,7 +649,7 @@ st35:
|
|
|
640
649
|
goto _out35;
|
|
641
650
|
case 35:
|
|
642
651
|
switch( (*p) ) {
|
|
643
|
-
case 32: goto
|
|
652
|
+
case 32: goto tr18;
|
|
644
653
|
case 36: goto st36;
|
|
645
654
|
case 95: goto st36;
|
|
646
655
|
}
|
|
@@ -658,7 +667,7 @@ st36:
|
|
|
658
667
|
goto _out36;
|
|
659
668
|
case 36:
|
|
660
669
|
switch( (*p) ) {
|
|
661
|
-
case 32: goto
|
|
670
|
+
case 32: goto tr18;
|
|
662
671
|
case 36: goto st37;
|
|
663
672
|
case 95: goto st37;
|
|
664
673
|
}
|
|
@@ -676,7 +685,7 @@ st37:
|
|
|
676
685
|
goto _out37;
|
|
677
686
|
case 37:
|
|
678
687
|
switch( (*p) ) {
|
|
679
|
-
case 32: goto
|
|
688
|
+
case 32: goto tr18;
|
|
680
689
|
case 36: goto st38;
|
|
681
690
|
case 95: goto st38;
|
|
682
691
|
}
|
|
@@ -694,7 +703,7 @@ st38:
|
|
|
694
703
|
goto _out38;
|
|
695
704
|
case 38:
|
|
696
705
|
switch( (*p) ) {
|
|
697
|
-
case 32: goto
|
|
706
|
+
case 32: goto tr18;
|
|
698
707
|
case 36: goto st39;
|
|
699
708
|
case 95: goto st39;
|
|
700
709
|
}
|
|
@@ -712,7 +721,7 @@ st39:
|
|
|
712
721
|
goto _out39;
|
|
713
722
|
case 39:
|
|
714
723
|
switch( (*p) ) {
|
|
715
|
-
case 32: goto
|
|
724
|
+
case 32: goto tr18;
|
|
716
725
|
case 36: goto st40;
|
|
717
726
|
case 95: goto st40;
|
|
718
727
|
}
|
|
@@ -730,7 +739,7 @@ st40:
|
|
|
730
739
|
goto _out40;
|
|
731
740
|
case 40:
|
|
732
741
|
switch( (*p) ) {
|
|
733
|
-
case 32: goto
|
|
742
|
+
case 32: goto tr18;
|
|
734
743
|
case 36: goto st41;
|
|
735
744
|
case 95: goto st41;
|
|
736
745
|
}
|
|
@@ -748,7 +757,7 @@ st41:
|
|
|
748
757
|
goto _out41;
|
|
749
758
|
case 41:
|
|
750
759
|
switch( (*p) ) {
|
|
751
|
-
case 32: goto
|
|
760
|
+
case 32: goto tr18;
|
|
752
761
|
case 36: goto st42;
|
|
753
762
|
case 95: goto st42;
|
|
754
763
|
}
|
|
@@ -766,7 +775,7 @@ st42:
|
|
|
766
775
|
goto _out42;
|
|
767
776
|
case 42:
|
|
768
777
|
switch( (*p) ) {
|
|
769
|
-
case 32: goto
|
|
778
|
+
case 32: goto tr18;
|
|
770
779
|
case 36: goto st43;
|
|
771
780
|
case 95: goto st43;
|
|
772
781
|
}
|
|
@@ -784,7 +793,7 @@ st43:
|
|
|
784
793
|
goto _out43;
|
|
785
794
|
case 43:
|
|
786
795
|
switch( (*p) ) {
|
|
787
|
-
case 32: goto
|
|
796
|
+
case 32: goto tr18;
|
|
788
797
|
case 36: goto st44;
|
|
789
798
|
case 95: goto st44;
|
|
790
799
|
}
|
|
@@ -802,7 +811,7 @@ st44:
|
|
|
802
811
|
goto _out44;
|
|
803
812
|
case 44:
|
|
804
813
|
switch( (*p) ) {
|
|
805
|
-
case 32: goto
|
|
814
|
+
case 32: goto tr18;
|
|
806
815
|
case 36: goto st45;
|
|
807
816
|
case 95: goto st45;
|
|
808
817
|
}
|
|
@@ -820,7 +829,7 @@ st45:
|
|
|
820
829
|
goto _out45;
|
|
821
830
|
case 45:
|
|
822
831
|
switch( (*p) ) {
|
|
823
|
-
case 32: goto
|
|
832
|
+
case 32: goto tr18;
|
|
824
833
|
case 36: goto st46;
|
|
825
834
|
case 95: goto st46;
|
|
826
835
|
}
|
|
@@ -838,7 +847,7 @@ st46:
|
|
|
838
847
|
goto _out46;
|
|
839
848
|
case 46:
|
|
840
849
|
switch( (*p) ) {
|
|
841
|
-
case 32: goto
|
|
850
|
+
case 32: goto tr18;
|
|
842
851
|
case 36: goto st47;
|
|
843
852
|
case 95: goto st47;
|
|
844
853
|
}
|
|
@@ -856,7 +865,7 @@ st47:
|
|
|
856
865
|
goto _out47;
|
|
857
866
|
case 47:
|
|
858
867
|
switch( (*p) ) {
|
|
859
|
-
case 32: goto
|
|
868
|
+
case 32: goto tr18;
|
|
860
869
|
case 36: goto st48;
|
|
861
870
|
case 95: goto st48;
|
|
862
871
|
}
|
|
@@ -874,7 +883,7 @@ st48:
|
|
|
874
883
|
goto _out48;
|
|
875
884
|
case 48:
|
|
876
885
|
switch( (*p) ) {
|
|
877
|
-
case 32: goto
|
|
886
|
+
case 32: goto tr18;
|
|
878
887
|
case 36: goto st49;
|
|
879
888
|
case 95: goto st49;
|
|
880
889
|
}
|
|
@@ -892,7 +901,7 @@ st49:
|
|
|
892
901
|
goto _out49;
|
|
893
902
|
case 49:
|
|
894
903
|
switch( (*p) ) {
|
|
895
|
-
case 32: goto
|
|
904
|
+
case 32: goto tr18;
|
|
896
905
|
case 36: goto st50;
|
|
897
906
|
case 95: goto st50;
|
|
898
907
|
}
|
|
@@ -910,7 +919,7 @@ st50:
|
|
|
910
919
|
goto _out50;
|
|
911
920
|
case 50:
|
|
912
921
|
if ( (*p) == 32 )
|
|
913
|
-
goto
|
|
922
|
+
goto tr18;
|
|
914
923
|
goto st1;
|
|
915
924
|
}
|
|
916
925
|
_out1: cs = 1; goto _out;
|
|
@@ -967,15 +976,23 @@ case 50:
|
|
|
967
976
|
|
|
968
977
|
_out: {}
|
|
969
978
|
}
|
|
970
|
-
#line
|
|
979
|
+
#line 156 "ext/http11/http11_parser.rl"
|
|
971
980
|
|
|
972
981
|
parser->cs = cs;
|
|
973
|
-
parser->nread
|
|
982
|
+
parser->nread += p - (buffer + off);
|
|
983
|
+
|
|
984
|
+
assert(p <= pe && "buffer overflow after parsing execute");
|
|
985
|
+
assert(parser->nread <= len && "nread longer than length");
|
|
986
|
+
assert(parser->body_start <= len && "body starts after buffer end");
|
|
987
|
+
assert(parser->mark < len && "mark is after buffer end");
|
|
988
|
+
assert(parser->field_len <= len && "field has length longer than whole buffer");
|
|
989
|
+
assert(parser->field_start < len && "field starts after buffer end");
|
|
990
|
+
|
|
974
991
|
if(parser->body_start) {
|
|
975
992
|
/* final \r\n combo encountered so stop right here */
|
|
976
993
|
|
|
977
|
-
#line
|
|
978
|
-
#line
|
|
994
|
+
#line 995 "ext/http11/http11_parser.c"
|
|
995
|
+
#line 170 "ext/http11/http11_parser.rl"
|
|
979
996
|
parser->nread++;
|
|
980
997
|
}
|
|
981
998
|
|
|
@@ -987,8 +1004,8 @@ int http_parser_finish(http_parser *parser)
|
|
|
987
1004
|
int cs = parser->cs;
|
|
988
1005
|
|
|
989
1006
|
|
|
990
|
-
#line
|
|
991
|
-
#line
|
|
1007
|
+
#line 1008 "ext/http11/http11_parser.c"
|
|
1008
|
+
#line 181 "ext/http11/http11_parser.rl"
|
|
992
1009
|
|
|
993
1010
|
parser->cs = cs;
|
|
994
1011
|
|