puma 3.0.0.rc1 → 5.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puma might be problematic. Click here for more details.

Files changed (91) hide show
  1. checksums.yaml +5 -5
  2. data/{History.txt → History.md} +703 -70
  3. data/LICENSE +23 -20
  4. data/README.md +173 -163
  5. data/docs/architecture.md +37 -0
  6. data/{DEPLOYMENT.md → docs/deployment.md} +28 -6
  7. data/docs/fork_worker.md +31 -0
  8. data/docs/images/puma-connection-flow-no-reactor.png +0 -0
  9. data/docs/images/puma-connection-flow.png +0 -0
  10. data/docs/images/puma-general-arch.png +0 -0
  11. data/docs/jungle/README.md +13 -0
  12. data/docs/jungle/rc.d/README.md +74 -0
  13. data/docs/jungle/rc.d/puma +61 -0
  14. data/docs/jungle/rc.d/puma.conf +10 -0
  15. data/{tools → docs}/jungle/upstart/README.md +0 -0
  16. data/{tools → docs}/jungle/upstart/puma-manager.conf +0 -0
  17. data/{tools → docs}/jungle/upstart/puma.conf +1 -1
  18. data/docs/nginx.md +2 -2
  19. data/docs/plugins.md +38 -0
  20. data/docs/restart.md +41 -0
  21. data/docs/signals.md +57 -3
  22. data/docs/systemd.md +228 -0
  23. data/ext/puma_http11/PumaHttp11Service.java +2 -2
  24. data/ext/puma_http11/extconf.rb +16 -0
  25. data/ext/puma_http11/http11_parser.c +287 -468
  26. data/ext/puma_http11/http11_parser.h +1 -0
  27. data/ext/puma_http11/http11_parser.java.rl +21 -37
  28. data/ext/puma_http11/http11_parser.rl +10 -9
  29. data/ext/puma_http11/http11_parser_common.rl +4 -4
  30. data/ext/puma_http11/mini_ssl.c +159 -10
  31. data/ext/puma_http11/org/jruby/puma/Http11.java +108 -116
  32. data/ext/puma_http11/org/jruby/puma/Http11Parser.java +99 -132
  33. data/ext/puma_http11/org/jruby/puma/MiniSSL.java +30 -6
  34. data/ext/puma_http11/puma_http11.c +6 -38
  35. data/lib/puma.rb +25 -5
  36. data/lib/puma/accept_nonblock.rb +7 -1
  37. data/lib/puma/app/status.rb +53 -26
  38. data/lib/puma/binder.rb +150 -119
  39. data/lib/puma/cli.rb +56 -38
  40. data/lib/puma/client.rb +277 -80
  41. data/lib/puma/cluster.rb +326 -130
  42. data/lib/puma/commonlogger.rb +21 -20
  43. data/lib/puma/configuration.rb +160 -161
  44. data/lib/puma/const.rb +50 -47
  45. data/lib/puma/control_cli.rb +104 -63
  46. data/lib/puma/detect.rb +13 -1
  47. data/lib/puma/dsl.rb +463 -114
  48. data/lib/puma/events.rb +22 -13
  49. data/lib/puma/io_buffer.rb +9 -5
  50. data/lib/puma/jruby_restart.rb +2 -59
  51. data/lib/puma/launcher.rb +195 -105
  52. data/lib/puma/minissl.rb +110 -4
  53. data/lib/puma/minissl/context_builder.rb +76 -0
  54. data/lib/puma/null_io.rb +9 -14
  55. data/lib/puma/plugin.rb +32 -12
  56. data/lib/puma/plugin/tmp_restart.rb +19 -6
  57. data/lib/puma/rack/builder.rb +7 -5
  58. data/lib/puma/rack/urlmap.rb +11 -8
  59. data/lib/puma/rack_default.rb +2 -0
  60. data/lib/puma/reactor.rb +242 -32
  61. data/lib/puma/runner.rb +41 -30
  62. data/lib/puma/server.rb +265 -183
  63. data/lib/puma/single.rb +22 -63
  64. data/lib/puma/state_file.rb +9 -2
  65. data/lib/puma/thread_pool.rb +179 -68
  66. data/lib/puma/util.rb +3 -11
  67. data/lib/rack/handler/puma.rb +60 -11
  68. data/tools/Dockerfile +16 -0
  69. data/tools/trickletest.rb +1 -2
  70. metadata +35 -99
  71. data/COPYING +0 -55
  72. data/Gemfile +0 -13
  73. data/Manifest.txt +0 -79
  74. data/Rakefile +0 -158
  75. data/docs/config.md +0 -0
  76. data/ext/puma_http11/io_buffer.c +0 -155
  77. data/lib/puma/capistrano.rb +0 -94
  78. data/lib/puma/compat.rb +0 -18
  79. data/lib/puma/convenient.rb +0 -23
  80. data/lib/puma/daemon_ext.rb +0 -31
  81. data/lib/puma/delegation.rb +0 -11
  82. data/lib/puma/java_io_buffer.rb +0 -45
  83. data/lib/puma/rack/backports/uri/common_18.rb +0 -56
  84. data/lib/puma/rack/backports/uri/common_192.rb +0 -52
  85. data/lib/puma/rack/backports/uri/common_193.rb +0 -29
  86. data/lib/puma/tcp_logger.rb +0 -32
  87. data/puma.gemspec +0 -52
  88. data/tools/jungle/README.md +0 -9
  89. data/tools/jungle/init.d/README.md +0 -54
  90. data/tools/jungle/init.d/puma +0 -394
  91. data/tools/jungle/init.d/run-puma +0 -3
@@ -0,0 +1,228 @@
1
+ # systemd
2
+
3
+ [systemd](https://www.freedesktop.org/wiki/Software/systemd/) is a
4
+ commonly available init system (PID 1) on many Linux distributions. It
5
+ offers process monitoring (including automatic restarts) and other
6
+ useful features for running Puma in production.
7
+
8
+ ## Service Configuration
9
+
10
+ Below is a sample puma.service configuration file for systemd, which
11
+ can be copied or symlinked to /etc/systemd/system/puma.service, or if
12
+ desired, using an application or instance specific name.
13
+
14
+ Note that this uses the systemd preferred "simple" type where the
15
+ start command remains running in the foreground (does not fork and
16
+ exit).
17
+
18
+ ~~~~ ini
19
+ [Unit]
20
+ Description=Puma HTTP Server
21
+ After=network.target
22
+
23
+ # Uncomment for socket activation (see below)
24
+ # Requires=puma.socket
25
+
26
+ [Service]
27
+ # Foreground process (do not use --daemon in ExecStart or config.rb)
28
+ Type=simple
29
+
30
+ # Preferably configure a non-privileged user
31
+ # User=
32
+
33
+ # The path to the your application code root directory.
34
+ # Also replace the "<YOUR_APP_PATH>" place holders below with this path.
35
+ # Example /home/username/myapp
36
+ WorkingDirectory=<YOUR_APP_PATH>
37
+
38
+ # Helpful for debugging socket activation, etc.
39
+ # Environment=PUMA_DEBUG=1
40
+
41
+ # SystemD will not run puma even if it is in your path. You must specify
42
+ # an absolute URL to puma. For example /usr/local/bin/puma
43
+ # Alternatively, create a binstub with `bundle binstubs puma --path ./sbin` in the WorkingDirectory
44
+ ExecStart=/<FULLPATH>/bin/puma -C <YOUR_APP_PATH>/puma.rb
45
+
46
+ # Variant: Rails start.
47
+ # ExecStart=/<FULLPATH>/bin/puma -C <YOUR_APP_PATH>/config/puma.rb ../config.ru
48
+
49
+ # Variant: Use `bundle exec --keep-file-descriptors puma` instead of binstub
50
+ # Variant: Specify directives inline.
51
+ # ExecStart=/<FULLPATH>/puma -b tcp://0.0.0.0:9292 -b ssl://0.0.0.0:9293?key=key.pem&cert=cert.pem
52
+
53
+
54
+ Restart=always
55
+
56
+ [Install]
57
+ WantedBy=multi-user.target
58
+ ~~~~
59
+
60
+ See [systemd.exec](https://www.freedesktop.org/software/systemd/man/systemd.exec.html)
61
+ for additional details.
62
+
63
+ ## Socket Activation
64
+
65
+ systemd and puma also support socket activation, where systemd opens
66
+ the listening socket(s) in advance and provides them to the puma
67
+ master process on startup. Among other advantages, this keeps
68
+ listening sockets open across puma restarts and achieves graceful
69
+ restarts, including when upgraded puma, and is compatible with both
70
+ clustered mode and application preload.
71
+
72
+ **Note:** Any wrapper scripts which `exec`, or other indirections in
73
+ `ExecStart`, may result in activated socket file descriptors being closed
74
+ before they reach the puma master process. For example, if using `bundle exec`,
75
+ pass the `--keep-file-descriptors` flag. `bundle exec` can be avoided by using a
76
+ `puma` executable generated by `bundle binstubs puma`. This is tracked in
77
+ [#1499].
78
+
79
+ **Note:** Socket activation doesn't currently work on jruby. This is
80
+ tracked in [#1367].
81
+
82
+ To use socket activation, configure one or more `ListenStream` sockets
83
+ in a companion `*.socket` unit file. Also uncomment the associated
84
+ `Requires` directive for the socket unit in the service file (see
85
+ above.) Here is a sample puma.socket, matching the ports used in the
86
+ above puma.service:
87
+
88
+ ~~~~ ini
89
+ [Unit]
90
+ Description=Puma HTTP Server Accept Sockets
91
+
92
+ [Socket]
93
+ ListenStream=0.0.0.0:9292
94
+ ListenStream=0.0.0.0:9293
95
+
96
+ # AF_UNIX domain socket
97
+ # SocketUser, SocketGroup, etc. may be needed for Unix domain sockets
98
+ # ListenStream=/run/puma.sock
99
+
100
+ # Socket options matching Puma defaults
101
+ NoDelay=true
102
+ ReusePort=true
103
+ Backlog=1024
104
+
105
+ [Install]
106
+ WantedBy=sockets.target
107
+ ~~~~
108
+
109
+ See [systemd.socket](https://www.freedesktop.org/software/systemd/man/systemd.socket.html)
110
+ for additional configuration details.
111
+
112
+ Note that the above configurations will work with Puma in either
113
+ single process or cluster mode.
114
+
115
+ ### Sockets and symlinks
116
+
117
+ When using releases folders, you should set the socket path using the
118
+ shared folder path (ex. `/srv/projet/shared/tmp/puma.sock`), not the
119
+ release folder path (`/srv/projet/releases/1234/tmp/puma.sock`).
120
+
121
+ Puma will detect the release path socket as different than the one provided by
122
+ systemd and attempt to bind it again, resulting in the exception
123
+ `There is already a server bound to:`.
124
+
125
+ ## Usage
126
+
127
+ Without socket activation, use `systemctl` as root (e.g. via `sudo`) as
128
+ with other system services:
129
+
130
+ ~~~~ sh
131
+ # After installing or making changes to puma.service
132
+ systemctl daemon-reload
133
+
134
+ # Enable so it starts on boot
135
+ systemctl enable puma.service
136
+
137
+ # Initial start up.
138
+ systemctl start puma.service
139
+
140
+ # Check status
141
+ systemctl status puma.service
142
+
143
+ # A normal restart. Warning: listeners sockets will be closed
144
+ # while a new puma process initializes.
145
+ systemctl restart puma.service
146
+ ~~~~
147
+
148
+ With socket activation, several but not all of these commands should
149
+ be run for both socket and service:
150
+
151
+ ~~~~ sh
152
+ # After installing or making changes to either puma.socket or
153
+ # puma.service.
154
+ systemctl daemon-reload
155
+
156
+ # Enable both socket and service so they start on boot. Alternatively
157
+ # you could leave puma.service disabled and systemd will start it on
158
+ # first use (with startup lag on first request)
159
+ systemctl enable puma.socket puma.service
160
+
161
+ # Initial start up. The Requires directive (see above) ensures the
162
+ # socket is started before the service.
163
+ systemctl start puma.socket puma.service
164
+
165
+ # Check status of both socket and service.
166
+ systemctl status puma.socket puma.service
167
+
168
+ # A "hot" restart, with systemd keeping puma.socket listening and
169
+ # providing to the new puma (master) instance.
170
+ systemctl restart puma.service
171
+
172
+ # A normal restart, needed to handle changes to
173
+ # puma.socket, such as changing the ListenStream ports. Note
174
+ # daemon-reload (above) should be run first.
175
+ systemctl restart puma.socket puma.service
176
+ ~~~~
177
+
178
+ Here is sample output from `systemctl status` with both service and
179
+ socket running:
180
+
181
+ ~~~~
182
+ ● puma.socket - Puma HTTP Server Accept Sockets
183
+ Loaded: loaded (/etc/systemd/system/puma.socket; enabled; vendor preset: enabled)
184
+ Active: active (running) since Thu 2016-04-07 08:40:19 PDT; 1h 2min ago
185
+ Listen: 0.0.0.0:9233 (Stream)
186
+ 0.0.0.0:9234 (Stream)
187
+
188
+ Apr 07 08:40:19 hx systemd[874]: Listening on Puma HTTP Server Accept Sockets.
189
+
190
+ ● puma.service - Puma HTTP Server
191
+ Loaded: loaded (/etc/systemd/system/puma.service; enabled; vendor preset: enabled)
192
+ Active: active (running) since Thu 2016-04-07 08:40:19 PDT; 1h 2min ago
193
+ Main PID: 28320 (ruby)
194
+ CGroup: /system.slice/puma.service
195
+ ├─28320 puma 3.3.0 (tcp://0.0.0.0:9233,ssl://0.0.0.0:9234?key=key.pem&cert=cert.pem) [app]
196
+ ├─28323 puma: cluster worker 0: 28320 [app]
197
+ └─28327 puma: cluster worker 1: 28320 [app]
198
+
199
+ Apr 07 08:40:19 hx puma[28320]: Puma starting in cluster mode...
200
+ Apr 07 08:40:19 hx puma[28320]: * Version 3.3.0 (ruby 2.2.4-p230), codename: Jovial Platypus
201
+ Apr 07 08:40:19 hx puma[28320]: * Min threads: 0, max threads: 16
202
+ Apr 07 08:40:19 hx puma[28320]: * Environment: production
203
+ Apr 07 08:40:19 hx puma[28320]: * Process workers: 2
204
+ Apr 07 08:40:19 hx puma[28320]: * Phased restart available
205
+ Apr 07 08:40:19 hx puma[28320]: * Activated tcp://0.0.0.0:9233
206
+ Apr 07 08:40:19 hx puma[28320]: * Activated ssl://0.0.0.0:9234?key=key.pem&cert=cert.pem
207
+ Apr 07 08:40:19 hx puma[28320]: Use Ctrl-C to stop
208
+ ~~~~
209
+
210
+ ### capistrano3-puma
211
+
212
+ By default,
213
+ [capistrano3-puma](https://github.com/seuros/capistrano-puma) uses
214
+ `pumactl` for deployment restarts, outside of systemd. To learn the
215
+ exact commands that this tool would use for `ExecStart` and
216
+ `ExecStop`, use the following `cap` commands in dry-run mode, and
217
+ update from the above forking service configuration accordingly. Note
218
+ also that the configured `User` should likely be the same as the
219
+ capistrano3-puma `:puma_user` option.
220
+
221
+ ~~~~ sh
222
+ stage=production # or different stage, as needed
223
+ cap $stage puma:start --dry-run
224
+ cap $stage puma:stop --dry-run
225
+ ~~~~
226
+
227
+ [Restart]: https://www.freedesktop.org/software/systemd/man/systemd.service.html#Restart=
228
+ [#1367]: https://github.com/puma/puma/issues/1367
@@ -1,14 +1,14 @@
1
1
  package puma;
2
2
 
3
3
  import java.io.IOException;
4
-
4
+
5
5
  import org.jruby.Ruby;
6
6
  import org.jruby.runtime.load.BasicLibraryService;
7
7
 
8
8
  import org.jruby.puma.Http11;
9
9
  import org.jruby.puma.MiniSSL;
10
10
 
11
- public class PumaHttp11Service implements BasicLibraryService {
11
+ public class PumaHttp11Service implements BasicLibraryService {
12
12
  public boolean basicLoad(final Ruby runtime) throws IOException {
13
13
  Http11.createHttp11(runtime);
14
14
  MiniSSL.createMiniSSL(runtime);
@@ -2,11 +2,27 @@ require 'mkmf'
2
2
 
3
3
  dir_config("puma_http11")
4
4
 
5
+ if $mingw && RUBY_VERSION >= '2.4'
6
+ append_cflags '-fstack-protector-strong -D_FORTIFY_SOURCE=2'
7
+ append_ldflags '-fstack-protector-strong -l:libssp.a'
8
+ have_library 'ssp'
9
+ end
10
+
5
11
  unless ENV["DISABLE_SSL"]
12
+ dir_config("openssl")
13
+
6
14
  if %w'crypto libeay32'.find {|crypto| have_library(crypto, 'BIO_read')} and
7
15
  %w'ssl ssleay32'.find {|ssl| have_library(ssl, 'SSL_CTX_new')}
8
16
 
9
17
  have_header "openssl/bio.h"
18
+
19
+ # below is yes for 1.0.2 & later
20
+ have_func "DTLS_method" , "openssl/ssl.h"
21
+
22
+ # below are yes for 1.1.0 & later, may need to check func rather than macro
23
+ # with versions after 1.1.1
24
+ have_func "TLS_server_method" , "openssl/ssl.h"
25
+ have_macro "SSL_CTX_set_min_proto_version", "openssl/ssl.h"
10
26
  end
11
27
  end
12
28
 
@@ -1,8 +1,9 @@
1
1
 
2
- #line 1 "ext/http11/http11_parser.rl"
2
+ #line 1 "ext/puma_http11/http11_parser.rl"
3
3
  /**
4
4
  * Copyright (c) 2005 Zed A. Shaw
5
5
  * You can redistribute it and/or modify it under the same terms as Ruby.
6
+ * License 3-clause BSD
6
7
  */
7
8
  #include "http11_parser.h"
8
9
  #include <stdio.h>
@@ -30,30 +31,30 @@ static void snake_upcase_char(char *c)
30
31
  /** Machine **/
31
32
 
32
33
 
33
- #line 78 "ext/http11/http11_parser.rl"
34
+ #line 79 "ext/puma_http11/http11_parser.rl"
34
35
 
35
36
 
36
37
  /** Data **/
37
38
 
38
- #line 39 "ext/http11/http11_parser.c"
39
+ #line 40 "ext/puma_http11/http11_parser.c"
39
40
  static const int puma_parser_start = 1;
40
- static const int puma_parser_first_final = 57;
41
+ static const int puma_parser_first_final = 46;
41
42
  static const int puma_parser_error = 0;
42
43
 
43
44
  static const int puma_parser_en_main = 1;
44
45
 
45
46
 
46
- #line 82 "ext/http11/http11_parser.rl"
47
+ #line 83 "ext/puma_http11/http11_parser.rl"
47
48
 
48
49
  int puma_parser_init(puma_parser *parser) {
49
50
  int cs = 0;
50
51
 
51
- #line 52 "ext/http11/http11_parser.c"
52
+ #line 53 "ext/puma_http11/http11_parser.c"
52
53
  {
53
54
  cs = puma_parser_start;
54
55
  }
55
56
 
56
- #line 86 "ext/http11/http11_parser.rl"
57
+ #line 87 "ext/puma_http11/http11_parser.rl"
57
58
  parser->cs = cs;
58
59
  parser->body_start = 0;
59
60
  parser->content_len = 0;
@@ -79,10 +80,10 @@ size_t puma_parser_execute(puma_parser *parser, const char *buffer, size_t len,
79
80
  pe = buffer+len;
80
81
 
81
82
  /* assert(*pe == '\0' && "pointer does not end on NUL"); */
82
- assert(pe - p == len - off && "pointers aren't same distance");
83
+ assert((size_t) (pe - p) == len - off && "pointers aren't same distance");
83
84
 
84
85
 
85
- #line 86 "ext/http11/http11_parser.c"
86
+ #line 87 "ext/puma_http11/http11_parser.c"
86
87
  {
87
88
  if ( p == pe )
88
89
  goto _test_eof;
@@ -106,31 +107,31 @@ st0:
106
107
  cs = 0;
107
108
  goto _out;
108
109
  tr0:
109
- #line 34 "ext/http11/http11_parser.rl"
110
+ #line 35 "ext/puma_http11/http11_parser.rl"
110
111
  { MARK(mark, p); }
111
112
  goto st2;
112
113
  st2:
113
114
  if ( ++p == pe )
114
115
  goto _test_eof2;
115
116
  case 2:
116
- #line 117 "ext/http11/http11_parser.c"
117
+ #line 118 "ext/puma_http11/http11_parser.c"
117
118
  switch( (*p) ) {
118
119
  case 32: goto tr2;
119
- case 36: goto st38;
120
- case 95: goto st38;
120
+ case 36: goto st27;
121
+ case 95: goto st27;
121
122
  }
122
123
  if ( (*p) < 48 ) {
123
124
  if ( 45 <= (*p) && (*p) <= 46 )
124
- goto st38;
125
+ goto st27;
125
126
  } else if ( (*p) > 57 ) {
126
127
  if ( 65 <= (*p) && (*p) <= 90 )
127
- goto st38;
128
+ goto st27;
128
129
  } else
129
- goto st38;
130
+ goto st27;
130
131
  goto st0;
131
132
  tr2:
132
- #line 47 "ext/http11/http11_parser.rl"
133
- {
133
+ #line 48 "ext/puma_http11/http11_parser.rl"
134
+ {
134
135
  parser->request_method(parser, PTR_TO(mark), LEN(mark, p));
135
136
  }
136
137
  goto st3;
@@ -138,7 +139,7 @@ st3:
138
139
  if ( ++p == pe )
139
140
  goto _test_eof3;
140
141
  case 3:
141
- #line 142 "ext/http11/http11_parser.c"
142
+ #line 143 "ext/puma_http11/http11_parser.c"
142
143
  switch( (*p) ) {
143
144
  case 42: goto tr4;
144
145
  case 43: goto tr5;
@@ -155,68 +156,68 @@ case 3:
155
156
  goto tr5;
156
157
  goto st0;
157
158
  tr4:
158
- #line 34 "ext/http11/http11_parser.rl"
159
+ #line 35 "ext/puma_http11/http11_parser.rl"
159
160
  { MARK(mark, p); }
160
161
  goto st4;
161
162
  st4:
162
163
  if ( ++p == pe )
163
164
  goto _test_eof4;
164
165
  case 4:
165
- #line 166 "ext/http11/http11_parser.c"
166
+ #line 167 "ext/puma_http11/http11_parser.c"
166
167
  switch( (*p) ) {
167
168
  case 32: goto tr8;
168
169
  case 35: goto tr9;
169
170
  }
170
171
  goto st0;
171
172
  tr8:
172
- #line 50 "ext/http11/http11_parser.rl"
173
- {
173
+ #line 51 "ext/puma_http11/http11_parser.rl"
174
+ {
174
175
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
175
176
  }
176
177
  goto st5;
177
178
  tr31:
178
- #line 34 "ext/http11/http11_parser.rl"
179
+ #line 35 "ext/puma_http11/http11_parser.rl"
179
180
  { MARK(mark, p); }
180
- #line 53 "ext/http11/http11_parser.rl"
181
+ #line 54 "ext/puma_http11/http11_parser.rl"
181
182
  {
182
183
  parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
183
184
  }
184
185
  goto st5;
185
- tr34:
186
- #line 53 "ext/http11/http11_parser.rl"
186
+ tr33:
187
+ #line 54 "ext/puma_http11/http11_parser.rl"
187
188
  {
188
189
  parser->fragment(parser, PTR_TO(mark), LEN(mark, p));
189
190
  }
190
191
  goto st5;
191
- tr42:
192
- #line 66 "ext/http11/http11_parser.rl"
192
+ tr37:
193
+ #line 67 "ext/puma_http11/http11_parser.rl"
193
194
  {
194
195
  parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
195
196
  }
196
- #line 50 "ext/http11/http11_parser.rl"
197
- {
197
+ #line 51 "ext/puma_http11/http11_parser.rl"
198
+ {
198
199
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
199
200
  }
200
201
  goto st5;
201
- tr53:
202
- #line 57 "ext/http11/http11_parser.rl"
202
+ tr41:
203
+ #line 58 "ext/puma_http11/http11_parser.rl"
203
204
  { MARK(query_start, p); }
204
- #line 58 "ext/http11/http11_parser.rl"
205
- {
205
+ #line 59 "ext/puma_http11/http11_parser.rl"
206
+ {
206
207
  parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
207
208
  }
208
- #line 50 "ext/http11/http11_parser.rl"
209
- {
209
+ #line 51 "ext/puma_http11/http11_parser.rl"
210
+ {
210
211
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
211
212
  }
212
213
  goto st5;
213
- tr57:
214
- #line 58 "ext/http11/http11_parser.rl"
215
- {
214
+ tr44:
215
+ #line 59 "ext/puma_http11/http11_parser.rl"
216
+ {
216
217
  parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
217
218
  }
218
- #line 50 "ext/http11/http11_parser.rl"
219
- {
219
+ #line 51 "ext/puma_http11/http11_parser.rl"
220
+ {
220
221
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
221
222
  }
222
223
  goto st5;
@@ -224,19 +225,19 @@ st5:
224
225
  if ( ++p == pe )
225
226
  goto _test_eof5;
226
227
  case 5:
227
- #line 228 "ext/http11/http11_parser.c"
228
+ #line 229 "ext/puma_http11/http11_parser.c"
228
229
  if ( (*p) == 72 )
229
230
  goto tr10;
230
231
  goto st0;
231
232
  tr10:
232
- #line 34 "ext/http11/http11_parser.rl"
233
+ #line 35 "ext/puma_http11/http11_parser.rl"
233
234
  { MARK(mark, p); }
234
235
  goto st6;
235
236
  st6:
236
237
  if ( ++p == pe )
237
238
  goto _test_eof6;
238
239
  case 6:
239
- #line 240 "ext/http11/http11_parser.c"
240
+ #line 241 "ext/puma_http11/http11_parser.c"
240
241
  if ( (*p) == 84 )
241
242
  goto st7;
242
243
  goto st0;
@@ -294,21 +295,21 @@ case 13:
294
295
  goto st13;
295
296
  goto st0;
296
297
  tr18:
297
- #line 62 "ext/http11/http11_parser.rl"
298
- {
298
+ #line 63 "ext/puma_http11/http11_parser.rl"
299
+ {
299
300
  parser->http_version(parser, PTR_TO(mark), LEN(mark, p));
300
301
  }
301
302
  goto st14;
302
303
  tr26:
303
- #line 43 "ext/http11/http11_parser.rl"
304
+ #line 44 "ext/puma_http11/http11_parser.rl"
304
305
  { MARK(mark, p); }
305
- #line 44 "ext/http11/http11_parser.rl"
306
+ #line 45 "ext/puma_http11/http11_parser.rl"
306
307
  {
307
308
  parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
308
309
  }
309
310
  goto st14;
310
311
  tr29:
311
- #line 44 "ext/http11/http11_parser.rl"
312
+ #line 45 "ext/puma_http11/http11_parser.rl"
312
313
  {
313
314
  parser->http_field(parser, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
314
315
  }
@@ -317,7 +318,7 @@ st14:
317
318
  if ( ++p == pe )
318
319
  goto _test_eof14;
319
320
  case 14:
320
- #line 321 "ext/http11/http11_parser.c"
321
+ #line 322 "ext/puma_http11/http11_parser.c"
321
322
  if ( (*p) == 10 )
322
323
  goto st15;
323
324
  goto st0;
@@ -357,34 +358,34 @@ case 16:
357
358
  goto tr22;
358
359
  goto st0;
359
360
  tr22:
360
- #line 70 "ext/http11/http11_parser.rl"
361
- {
362
- parser->body_start = p - buffer + 1;
361
+ #line 71 "ext/puma_http11/http11_parser.rl"
362
+ {
363
+ parser->body_start = p - buffer + 1;
363
364
  parser->header_done(parser, p + 1, pe - p - 1);
364
- {p++; cs = 57; goto _out;}
365
+ {p++; cs = 46; goto _out;}
365
366
  }
366
- goto st57;
367
- st57:
367
+ goto st46;
368
+ st46:
368
369
  if ( ++p == pe )
369
- goto _test_eof57;
370
- case 57:
371
- #line 372 "ext/http11/http11_parser.c"
370
+ goto _test_eof46;
371
+ case 46:
372
+ #line 373 "ext/puma_http11/http11_parser.c"
372
373
  goto st0;
373
374
  tr21:
374
- #line 37 "ext/http11/http11_parser.rl"
375
+ #line 38 "ext/puma_http11/http11_parser.rl"
375
376
  { MARK(field_start, p); }
376
- #line 38 "ext/http11/http11_parser.rl"
377
+ #line 39 "ext/puma_http11/http11_parser.rl"
377
378
  { snake_upcase_char((char *)p); }
378
379
  goto st17;
379
380
  tr23:
380
- #line 38 "ext/http11/http11_parser.rl"
381
+ #line 39 "ext/puma_http11/http11_parser.rl"
381
382
  { snake_upcase_char((char *)p); }
382
383
  goto st17;
383
384
  st17:
384
385
  if ( ++p == pe )
385
386
  goto _test_eof17;
386
387
  case 17:
387
- #line 388 "ext/http11/http11_parser.c"
388
+ #line 389 "ext/puma_http11/http11_parser.c"
388
389
  switch( (*p) ) {
389
390
  case 33: goto tr23;
390
391
  case 58: goto tr24;
@@ -410,72 +411,72 @@ case 17:
410
411
  goto tr23;
411
412
  goto st0;
412
413
  tr24:
413
- #line 39 "ext/http11/http11_parser.rl"
414
- {
414
+ #line 40 "ext/puma_http11/http11_parser.rl"
415
+ {
415
416
  parser->field_len = LEN(field_start, p);
416
417
  }
417
418
  goto st18;
418
419
  tr27:
419
- #line 43 "ext/http11/http11_parser.rl"
420
+ #line 44 "ext/puma_http11/http11_parser.rl"
420
421
  { MARK(mark, p); }
421
422
  goto st18;
422
423
  st18:
423
424
  if ( ++p == pe )
424
425
  goto _test_eof18;
425
426
  case 18:
426
- #line 427 "ext/http11/http11_parser.c"
427
+ #line 428 "ext/puma_http11/http11_parser.c"
427
428
  switch( (*p) ) {
428
429
  case 13: goto tr26;
429
430
  case 32: goto tr27;
430
431
  }
431
432
  goto tr25;
432
433
  tr25:
433
- #line 43 "ext/http11/http11_parser.rl"
434
+ #line 44 "ext/puma_http11/http11_parser.rl"
434
435
  { MARK(mark, p); }
435
436
  goto st19;
436
437
  st19:
437
438
  if ( ++p == pe )
438
439
  goto _test_eof19;
439
440
  case 19:
440
- #line 441 "ext/http11/http11_parser.c"
441
+ #line 442 "ext/puma_http11/http11_parser.c"
441
442
  if ( (*p) == 13 )
442
443
  goto tr29;
443
444
  goto st19;
444
445
  tr9:
445
- #line 50 "ext/http11/http11_parser.rl"
446
- {
446
+ #line 51 "ext/puma_http11/http11_parser.rl"
447
+ {
447
448
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
448
449
  }
449
450
  goto st20;
450
- tr43:
451
- #line 66 "ext/http11/http11_parser.rl"
451
+ tr38:
452
+ #line 67 "ext/puma_http11/http11_parser.rl"
452
453
  {
453
454
  parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
454
455
  }
455
- #line 50 "ext/http11/http11_parser.rl"
456
- {
456
+ #line 51 "ext/puma_http11/http11_parser.rl"
457
+ {
457
458
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
458
459
  }
459
460
  goto st20;
460
- tr54:
461
- #line 57 "ext/http11/http11_parser.rl"
461
+ tr42:
462
+ #line 58 "ext/puma_http11/http11_parser.rl"
462
463
  { MARK(query_start, p); }
463
- #line 58 "ext/http11/http11_parser.rl"
464
- {
464
+ #line 59 "ext/puma_http11/http11_parser.rl"
465
+ {
465
466
  parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
466
467
  }
467
- #line 50 "ext/http11/http11_parser.rl"
468
- {
468
+ #line 51 "ext/puma_http11/http11_parser.rl"
469
+ {
469
470
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
470
471
  }
471
472
  goto st20;
472
- tr58:
473
- #line 58 "ext/http11/http11_parser.rl"
474
- {
473
+ tr45:
474
+ #line 59 "ext/puma_http11/http11_parser.rl"
475
+ {
475
476
  parser->query_string(parser, PTR_TO(query_start), LEN(query_start, p));
476
477
  }
477
- #line 50 "ext/http11/http11_parser.rl"
478
- {
478
+ #line 51 "ext/puma_http11/http11_parser.rl"
479
+ {
479
480
  parser->request_uri(parser, PTR_TO(mark), LEN(mark, p));
480
481
  }
481
482
  goto st20;
@@ -483,10 +484,9 @@ st20:
483
484
  if ( ++p == pe )
484
485
  goto _test_eof20;
485
486
  case 20:
486
- #line 487 "ext/http11/http11_parser.c"
487
+ #line 488 "ext/puma_http11/http11_parser.c"
487
488
  switch( (*p) ) {
488
489
  case 32: goto tr31;
489
- case 37: goto tr32;
490
490
  case 60: goto st0;
491
491
  case 62: goto st0;
492
492
  case 127: goto st0;
@@ -498,17 +498,16 @@ case 20:
498
498
  goto st0;
499
499
  goto tr30;
500
500
  tr30:
501
- #line 34 "ext/http11/http11_parser.rl"
501
+ #line 35 "ext/puma_http11/http11_parser.rl"
502
502
  { MARK(mark, p); }
503
503
  goto st21;
504
504
  st21:
505
505
  if ( ++p == pe )
506
506
  goto _test_eof21;
507
507
  case 21:
508
- #line 509 "ext/http11/http11_parser.c"
508
+ #line 509 "ext/puma_http11/http11_parser.c"
509
509
  switch( (*p) ) {
510
- case 32: goto tr34;
511
- case 37: goto st22;
510
+ case 32: goto tr33;
512
511
  case 60: goto st0;
513
512
  case 62: goto st0;
514
513
  case 127: goto st0;
@@ -519,611 +518,442 @@ case 21:
519
518
  } else if ( (*p) >= 0 )
520
519
  goto st0;
521
520
  goto st21;
522
- tr32:
523
- #line 34 "ext/http11/http11_parser.rl"
521
+ tr5:
522
+ #line 35 "ext/puma_http11/http11_parser.rl"
524
523
  { MARK(mark, p); }
525
524
  goto st22;
526
525
  st22:
527
526
  if ( ++p == pe )
528
527
  goto _test_eof22;
529
528
  case 22:
530
- #line 531 "ext/http11/http11_parser.c"
531
- if ( (*p) < 65 ) {
532
- if ( 48 <= (*p) && (*p) <= 57 )
533
- goto st23;
534
- } else if ( (*p) > 70 ) {
535
- if ( 97 <= (*p) && (*p) <= 102 )
536
- goto st23;
537
- } else
538
- goto st23;
539
- goto st0;
540
- st23:
541
- if ( ++p == pe )
542
- goto _test_eof23;
543
- case 23:
544
- if ( (*p) < 65 ) {
545
- if ( 48 <= (*p) && (*p) <= 57 )
546
- goto st21;
547
- } else if ( (*p) > 70 ) {
548
- if ( 97 <= (*p) && (*p) <= 102 )
549
- goto st21;
550
- } else
551
- goto st21;
552
- goto st0;
553
- tr5:
554
- #line 34 "ext/http11/http11_parser.rl"
555
- { MARK(mark, p); }
556
- goto st24;
557
- st24:
558
- if ( ++p == pe )
559
- goto _test_eof24;
560
- case 24:
561
- #line 562 "ext/http11/http11_parser.c"
529
+ #line 530 "ext/puma_http11/http11_parser.c"
562
530
  switch( (*p) ) {
563
- case 43: goto st24;
564
- case 58: goto st25;
531
+ case 43: goto st22;
532
+ case 58: goto st23;
565
533
  }
566
534
  if ( (*p) < 48 ) {
567
535
  if ( 45 <= (*p) && (*p) <= 46 )
568
- goto st24;
536
+ goto st22;
569
537
  } else if ( (*p) > 57 ) {
570
538
  if ( (*p) > 90 ) {
571
539
  if ( 97 <= (*p) && (*p) <= 122 )
572
- goto st24;
540
+ goto st22;
573
541
  } else if ( (*p) >= 65 )
574
- goto st24;
542
+ goto st22;
575
543
  } else
576
- goto st24;
544
+ goto st22;
577
545
  goto st0;
578
546
  tr7:
579
- #line 34 "ext/http11/http11_parser.rl"
547
+ #line 35 "ext/puma_http11/http11_parser.rl"
580
548
  { MARK(mark, p); }
581
- goto st25;
582
- st25:
549
+ goto st23;
550
+ st23:
583
551
  if ( ++p == pe )
584
- goto _test_eof25;
585
- case 25:
586
- #line 587 "ext/http11/http11_parser.c"
552
+ goto _test_eof23;
553
+ case 23:
554
+ #line 555 "ext/puma_http11/http11_parser.c"
587
555
  switch( (*p) ) {
588
556
  case 32: goto tr8;
589
557
  case 34: goto st0;
590
558
  case 35: goto tr9;
591
- case 37: goto st26;
592
559
  case 60: goto st0;
593
560
  case 62: goto st0;
594
561
  case 127: goto st0;
595
562
  }
596
563
  if ( 0 <= (*p) && (*p) <= 31 )
597
564
  goto st0;
598
- goto st25;
599
- st26:
600
- if ( ++p == pe )
601
- goto _test_eof26;
602
- case 26:
603
- if ( (*p) < 65 ) {
604
- if ( 48 <= (*p) && (*p) <= 57 )
605
- goto st27;
606
- } else if ( (*p) > 70 ) {
607
- if ( 97 <= (*p) && (*p) <= 102 )
608
- goto st27;
609
- } else
610
- goto st27;
611
- goto st0;
612
- st27:
613
- if ( ++p == pe )
614
- goto _test_eof27;
615
- case 27:
616
- if ( (*p) < 65 ) {
617
- if ( 48 <= (*p) && (*p) <= 57 )
618
- goto st25;
619
- } else if ( (*p) > 70 ) {
620
- if ( 97 <= (*p) && (*p) <= 102 )
621
- goto st25;
622
- } else
623
- goto st25;
624
- goto st0;
565
+ goto st23;
625
566
  tr6:
626
- #line 34 "ext/http11/http11_parser.rl"
567
+ #line 35 "ext/puma_http11/http11_parser.rl"
627
568
  { MARK(mark, p); }
628
- goto st28;
629
- st28:
630
- if ( ++p == pe )
631
- goto _test_eof28;
632
- case 28:
633
- #line 634 "ext/http11/http11_parser.c"
634
- switch( (*p) ) {
635
- case 32: goto tr42;
636
- case 34: goto st0;
637
- case 35: goto tr43;
638
- case 37: goto st29;
639
- case 59: goto tr45;
640
- case 60: goto st0;
641
- case 62: goto st0;
642
- case 63: goto tr46;
643
- case 127: goto st0;
644
- }
645
- if ( 0 <= (*p) && (*p) <= 31 )
646
- goto st0;
647
- goto st28;
648
- st29:
649
- if ( ++p == pe )
650
- goto _test_eof29;
651
- case 29:
652
- if ( (*p) < 65 ) {
653
- if ( 48 <= (*p) && (*p) <= 57 )
654
- goto st30;
655
- } else if ( (*p) > 70 ) {
656
- if ( 97 <= (*p) && (*p) <= 102 )
657
- goto st30;
658
- } else
659
- goto st30;
660
- goto st0;
661
- st30:
662
- if ( ++p == pe )
663
- goto _test_eof30;
664
- case 30:
665
- if ( (*p) < 65 ) {
666
- if ( 48 <= (*p) && (*p) <= 57 )
667
- goto st28;
668
- } else if ( (*p) > 70 ) {
669
- if ( 97 <= (*p) && (*p) <= 102 )
670
- goto st28;
671
- } else
672
- goto st28;
673
- goto st0;
674
- tr45:
675
- #line 66 "ext/http11/http11_parser.rl"
676
- {
677
- parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
678
- }
679
- goto st31;
680
- st31:
569
+ goto st24;
570
+ st24:
681
571
  if ( ++p == pe )
682
- goto _test_eof31;
683
- case 31:
684
- #line 685 "ext/http11/http11_parser.c"
572
+ goto _test_eof24;
573
+ case 24:
574
+ #line 575 "ext/puma_http11/http11_parser.c"
685
575
  switch( (*p) ) {
686
- case 32: goto tr8;
576
+ case 32: goto tr37;
687
577
  case 34: goto st0;
688
- case 35: goto tr9;
689
- case 37: goto st32;
578
+ case 35: goto tr38;
690
579
  case 60: goto st0;
691
580
  case 62: goto st0;
692
- case 63: goto st34;
581
+ case 63: goto tr39;
693
582
  case 127: goto st0;
694
583
  }
695
584
  if ( 0 <= (*p) && (*p) <= 31 )
696
585
  goto st0;
697
- goto st31;
698
- st32:
699
- if ( ++p == pe )
700
- goto _test_eof32;
701
- case 32:
702
- if ( (*p) < 65 ) {
703
- if ( 48 <= (*p) && (*p) <= 57 )
704
- goto st33;
705
- } else if ( (*p) > 70 ) {
706
- if ( 97 <= (*p) && (*p) <= 102 )
707
- goto st33;
708
- } else
709
- goto st33;
710
- goto st0;
711
- st33:
712
- if ( ++p == pe )
713
- goto _test_eof33;
714
- case 33:
715
- if ( (*p) < 65 ) {
716
- if ( 48 <= (*p) && (*p) <= 57 )
717
- goto st31;
718
- } else if ( (*p) > 70 ) {
719
- if ( 97 <= (*p) && (*p) <= 102 )
720
- goto st31;
721
- } else
722
- goto st31;
723
- goto st0;
724
- tr46:
725
- #line 66 "ext/http11/http11_parser.rl"
586
+ goto st24;
587
+ tr39:
588
+ #line 67 "ext/puma_http11/http11_parser.rl"
726
589
  {
727
590
  parser->request_path(parser, PTR_TO(mark), LEN(mark,p));
728
591
  }
729
- goto st34;
730
- st34:
592
+ goto st25;
593
+ st25:
731
594
  if ( ++p == pe )
732
- goto _test_eof34;
733
- case 34:
734
- #line 735 "ext/http11/http11_parser.c"
595
+ goto _test_eof25;
596
+ case 25:
597
+ #line 598 "ext/puma_http11/http11_parser.c"
735
598
  switch( (*p) ) {
736
- case 32: goto tr53;
599
+ case 32: goto tr41;
737
600
  case 34: goto st0;
738
- case 35: goto tr54;
739
- case 37: goto tr55;
601
+ case 35: goto tr42;
740
602
  case 60: goto st0;
741
603
  case 62: goto st0;
742
604
  case 127: goto st0;
743
605
  }
744
606
  if ( 0 <= (*p) && (*p) <= 31 )
745
607
  goto st0;
746
- goto tr52;
747
- tr52:
748
- #line 57 "ext/http11/http11_parser.rl"
608
+ goto tr40;
609
+ tr40:
610
+ #line 58 "ext/puma_http11/http11_parser.rl"
749
611
  { MARK(query_start, p); }
750
- goto st35;
751
- st35:
612
+ goto st26;
613
+ st26:
752
614
  if ( ++p == pe )
753
- goto _test_eof35;
754
- case 35:
755
- #line 756 "ext/http11/http11_parser.c"
615
+ goto _test_eof26;
616
+ case 26:
617
+ #line 618 "ext/puma_http11/http11_parser.c"
756
618
  switch( (*p) ) {
757
- case 32: goto tr57;
619
+ case 32: goto tr44;
758
620
  case 34: goto st0;
759
- case 35: goto tr58;
760
- case 37: goto st36;
621
+ case 35: goto tr45;
761
622
  case 60: goto st0;
762
623
  case 62: goto st0;
763
624
  case 127: goto st0;
764
625
  }
765
626
  if ( 0 <= (*p) && (*p) <= 31 )
766
627
  goto st0;
767
- goto st35;
768
- tr55:
769
- #line 57 "ext/http11/http11_parser.rl"
770
- { MARK(query_start, p); }
771
- goto st36;
772
- st36:
773
- if ( ++p == pe )
774
- goto _test_eof36;
775
- case 36:
776
- #line 777 "ext/http11/http11_parser.c"
777
- if ( (*p) < 65 ) {
778
- if ( 48 <= (*p) && (*p) <= 57 )
779
- goto st37;
780
- } else if ( (*p) > 70 ) {
781
- if ( 97 <= (*p) && (*p) <= 102 )
782
- goto st37;
783
- } else
784
- goto st37;
785
- goto st0;
786
- st37:
787
- if ( ++p == pe )
788
- goto _test_eof37;
789
- case 37:
790
- if ( (*p) < 65 ) {
791
- if ( 48 <= (*p) && (*p) <= 57 )
792
- goto st35;
793
- } else if ( (*p) > 70 ) {
794
- if ( 97 <= (*p) && (*p) <= 102 )
795
- goto st35;
796
- } else
797
- goto st35;
798
- goto st0;
799
- st38:
628
+ goto st26;
629
+ st27:
800
630
  if ( ++p == pe )
801
- goto _test_eof38;
802
- case 38:
631
+ goto _test_eof27;
632
+ case 27:
803
633
  switch( (*p) ) {
804
634
  case 32: goto tr2;
805
- case 36: goto st39;
806
- case 95: goto st39;
635
+ case 36: goto st28;
636
+ case 95: goto st28;
807
637
  }
808
638
  if ( (*p) < 48 ) {
809
639
  if ( 45 <= (*p) && (*p) <= 46 )
810
- goto st39;
640
+ goto st28;
811
641
  } else if ( (*p) > 57 ) {
812
642
  if ( 65 <= (*p) && (*p) <= 90 )
813
- goto st39;
643
+ goto st28;
814
644
  } else
815
- goto st39;
645
+ goto st28;
816
646
  goto st0;
817
- st39:
647
+ st28:
818
648
  if ( ++p == pe )
819
- goto _test_eof39;
820
- case 39:
649
+ goto _test_eof28;
650
+ case 28:
821
651
  switch( (*p) ) {
822
652
  case 32: goto tr2;
823
- case 36: goto st40;
824
- case 95: goto st40;
653
+ case 36: goto st29;
654
+ case 95: goto st29;
825
655
  }
826
656
  if ( (*p) < 48 ) {
827
657
  if ( 45 <= (*p) && (*p) <= 46 )
828
- goto st40;
658
+ goto st29;
829
659
  } else if ( (*p) > 57 ) {
830
660
  if ( 65 <= (*p) && (*p) <= 90 )
831
- goto st40;
661
+ goto st29;
832
662
  } else
833
- goto st40;
663
+ goto st29;
834
664
  goto st0;
835
- st40:
665
+ st29:
836
666
  if ( ++p == pe )
837
- goto _test_eof40;
838
- case 40:
667
+ goto _test_eof29;
668
+ case 29:
839
669
  switch( (*p) ) {
840
670
  case 32: goto tr2;
841
- case 36: goto st41;
842
- case 95: goto st41;
671
+ case 36: goto st30;
672
+ case 95: goto st30;
843
673
  }
844
674
  if ( (*p) < 48 ) {
845
675
  if ( 45 <= (*p) && (*p) <= 46 )
846
- goto st41;
676
+ goto st30;
847
677
  } else if ( (*p) > 57 ) {
848
678
  if ( 65 <= (*p) && (*p) <= 90 )
849
- goto st41;
679
+ goto st30;
850
680
  } else
851
- goto st41;
681
+ goto st30;
852
682
  goto st0;
853
- st41:
683
+ st30:
854
684
  if ( ++p == pe )
855
- goto _test_eof41;
856
- case 41:
685
+ goto _test_eof30;
686
+ case 30:
857
687
  switch( (*p) ) {
858
688
  case 32: goto tr2;
859
- case 36: goto st42;
860
- case 95: goto st42;
689
+ case 36: goto st31;
690
+ case 95: goto st31;
861
691
  }
862
692
  if ( (*p) < 48 ) {
863
693
  if ( 45 <= (*p) && (*p) <= 46 )
864
- goto st42;
694
+ goto st31;
865
695
  } else if ( (*p) > 57 ) {
866
696
  if ( 65 <= (*p) && (*p) <= 90 )
867
- goto st42;
697
+ goto st31;
868
698
  } else
869
- goto st42;
699
+ goto st31;
870
700
  goto st0;
871
- st42:
701
+ st31:
872
702
  if ( ++p == pe )
873
- goto _test_eof42;
874
- case 42:
703
+ goto _test_eof31;
704
+ case 31:
875
705
  switch( (*p) ) {
876
706
  case 32: goto tr2;
877
- case 36: goto st43;
878
- case 95: goto st43;
707
+ case 36: goto st32;
708
+ case 95: goto st32;
879
709
  }
880
710
  if ( (*p) < 48 ) {
881
711
  if ( 45 <= (*p) && (*p) <= 46 )
882
- goto st43;
712
+ goto st32;
883
713
  } else if ( (*p) > 57 ) {
884
714
  if ( 65 <= (*p) && (*p) <= 90 )
885
- goto st43;
715
+ goto st32;
886
716
  } else
887
- goto st43;
717
+ goto st32;
888
718
  goto st0;
889
- st43:
719
+ st32:
890
720
  if ( ++p == pe )
891
- goto _test_eof43;
892
- case 43:
721
+ goto _test_eof32;
722
+ case 32:
893
723
  switch( (*p) ) {
894
724
  case 32: goto tr2;
895
- case 36: goto st44;
896
- case 95: goto st44;
725
+ case 36: goto st33;
726
+ case 95: goto st33;
897
727
  }
898
728
  if ( (*p) < 48 ) {
899
729
  if ( 45 <= (*p) && (*p) <= 46 )
900
- goto st44;
730
+ goto st33;
901
731
  } else if ( (*p) > 57 ) {
902
732
  if ( 65 <= (*p) && (*p) <= 90 )
903
- goto st44;
733
+ goto st33;
904
734
  } else
905
- goto st44;
735
+ goto st33;
906
736
  goto st0;
907
- st44:
737
+ st33:
908
738
  if ( ++p == pe )
909
- goto _test_eof44;
910
- case 44:
739
+ goto _test_eof33;
740
+ case 33:
911
741
  switch( (*p) ) {
912
742
  case 32: goto tr2;
913
- case 36: goto st45;
914
- case 95: goto st45;
743
+ case 36: goto st34;
744
+ case 95: goto st34;
915
745
  }
916
746
  if ( (*p) < 48 ) {
917
747
  if ( 45 <= (*p) && (*p) <= 46 )
918
- goto st45;
748
+ goto st34;
919
749
  } else if ( (*p) > 57 ) {
920
750
  if ( 65 <= (*p) && (*p) <= 90 )
921
- goto st45;
751
+ goto st34;
922
752
  } else
923
- goto st45;
753
+ goto st34;
924
754
  goto st0;
925
- st45:
755
+ st34:
926
756
  if ( ++p == pe )
927
- goto _test_eof45;
928
- case 45:
757
+ goto _test_eof34;
758
+ case 34:
929
759
  switch( (*p) ) {
930
760
  case 32: goto tr2;
931
- case 36: goto st46;
932
- case 95: goto st46;
761
+ case 36: goto st35;
762
+ case 95: goto st35;
933
763
  }
934
764
  if ( (*p) < 48 ) {
935
765
  if ( 45 <= (*p) && (*p) <= 46 )
936
- goto st46;
766
+ goto st35;
937
767
  } else if ( (*p) > 57 ) {
938
768
  if ( 65 <= (*p) && (*p) <= 90 )
939
- goto st46;
769
+ goto st35;
940
770
  } else
941
- goto st46;
771
+ goto st35;
942
772
  goto st0;
943
- st46:
773
+ st35:
944
774
  if ( ++p == pe )
945
- goto _test_eof46;
946
- case 46:
775
+ goto _test_eof35;
776
+ case 35:
947
777
  switch( (*p) ) {
948
778
  case 32: goto tr2;
949
- case 36: goto st47;
950
- case 95: goto st47;
779
+ case 36: goto st36;
780
+ case 95: goto st36;
951
781
  }
952
782
  if ( (*p) < 48 ) {
953
783
  if ( 45 <= (*p) && (*p) <= 46 )
954
- goto st47;
784
+ goto st36;
955
785
  } else if ( (*p) > 57 ) {
956
786
  if ( 65 <= (*p) && (*p) <= 90 )
957
- goto st47;
787
+ goto st36;
958
788
  } else
959
- goto st47;
789
+ goto st36;
960
790
  goto st0;
961
- st47:
791
+ st36:
962
792
  if ( ++p == pe )
963
- goto _test_eof47;
964
- case 47:
793
+ goto _test_eof36;
794
+ case 36:
965
795
  switch( (*p) ) {
966
796
  case 32: goto tr2;
967
- case 36: goto st48;
968
- case 95: goto st48;
797
+ case 36: goto st37;
798
+ case 95: goto st37;
969
799
  }
970
800
  if ( (*p) < 48 ) {
971
801
  if ( 45 <= (*p) && (*p) <= 46 )
972
- goto st48;
802
+ goto st37;
973
803
  } else if ( (*p) > 57 ) {
974
804
  if ( 65 <= (*p) && (*p) <= 90 )
975
- goto st48;
805
+ goto st37;
976
806
  } else
977
- goto st48;
807
+ goto st37;
978
808
  goto st0;
979
- st48:
809
+ st37:
980
810
  if ( ++p == pe )
981
- goto _test_eof48;
982
- case 48:
811
+ goto _test_eof37;
812
+ case 37:
983
813
  switch( (*p) ) {
984
814
  case 32: goto tr2;
985
- case 36: goto st49;
986
- case 95: goto st49;
815
+ case 36: goto st38;
816
+ case 95: goto st38;
987
817
  }
988
818
  if ( (*p) < 48 ) {
989
819
  if ( 45 <= (*p) && (*p) <= 46 )
990
- goto st49;
820
+ goto st38;
991
821
  } else if ( (*p) > 57 ) {
992
822
  if ( 65 <= (*p) && (*p) <= 90 )
993
- goto st49;
823
+ goto st38;
994
824
  } else
995
- goto st49;
825
+ goto st38;
996
826
  goto st0;
997
- st49:
827
+ st38:
998
828
  if ( ++p == pe )
999
- goto _test_eof49;
1000
- case 49:
829
+ goto _test_eof38;
830
+ case 38:
1001
831
  switch( (*p) ) {
1002
832
  case 32: goto tr2;
1003
- case 36: goto st50;
1004
- case 95: goto st50;
833
+ case 36: goto st39;
834
+ case 95: goto st39;
1005
835
  }
1006
836
  if ( (*p) < 48 ) {
1007
837
  if ( 45 <= (*p) && (*p) <= 46 )
1008
- goto st50;
838
+ goto st39;
1009
839
  } else if ( (*p) > 57 ) {
1010
840
  if ( 65 <= (*p) && (*p) <= 90 )
1011
- goto st50;
841
+ goto st39;
1012
842
  } else
1013
- goto st50;
843
+ goto st39;
1014
844
  goto st0;
1015
- st50:
845
+ st39:
1016
846
  if ( ++p == pe )
1017
- goto _test_eof50;
1018
- case 50:
847
+ goto _test_eof39;
848
+ case 39:
1019
849
  switch( (*p) ) {
1020
850
  case 32: goto tr2;
1021
- case 36: goto st51;
1022
- case 95: goto st51;
851
+ case 36: goto st40;
852
+ case 95: goto st40;
1023
853
  }
1024
854
  if ( (*p) < 48 ) {
1025
855
  if ( 45 <= (*p) && (*p) <= 46 )
1026
- goto st51;
856
+ goto st40;
1027
857
  } else if ( (*p) > 57 ) {
1028
858
  if ( 65 <= (*p) && (*p) <= 90 )
1029
- goto st51;
859
+ goto st40;
1030
860
  } else
1031
- goto st51;
861
+ goto st40;
1032
862
  goto st0;
1033
- st51:
863
+ st40:
1034
864
  if ( ++p == pe )
1035
- goto _test_eof51;
1036
- case 51:
865
+ goto _test_eof40;
866
+ case 40:
1037
867
  switch( (*p) ) {
1038
868
  case 32: goto tr2;
1039
- case 36: goto st52;
1040
- case 95: goto st52;
869
+ case 36: goto st41;
870
+ case 95: goto st41;
1041
871
  }
1042
872
  if ( (*p) < 48 ) {
1043
873
  if ( 45 <= (*p) && (*p) <= 46 )
1044
- goto st52;
874
+ goto st41;
1045
875
  } else if ( (*p) > 57 ) {
1046
876
  if ( 65 <= (*p) && (*p) <= 90 )
1047
- goto st52;
877
+ goto st41;
1048
878
  } else
1049
- goto st52;
879
+ goto st41;
1050
880
  goto st0;
1051
- st52:
881
+ st41:
1052
882
  if ( ++p == pe )
1053
- goto _test_eof52;
1054
- case 52:
883
+ goto _test_eof41;
884
+ case 41:
1055
885
  switch( (*p) ) {
1056
886
  case 32: goto tr2;
1057
- case 36: goto st53;
1058
- case 95: goto st53;
887
+ case 36: goto st42;
888
+ case 95: goto st42;
1059
889
  }
1060
890
  if ( (*p) < 48 ) {
1061
891
  if ( 45 <= (*p) && (*p) <= 46 )
1062
- goto st53;
892
+ goto st42;
1063
893
  } else if ( (*p) > 57 ) {
1064
894
  if ( 65 <= (*p) && (*p) <= 90 )
1065
- goto st53;
895
+ goto st42;
1066
896
  } else
1067
- goto st53;
897
+ goto st42;
1068
898
  goto st0;
1069
- st53:
899
+ st42:
1070
900
  if ( ++p == pe )
1071
- goto _test_eof53;
1072
- case 53:
901
+ goto _test_eof42;
902
+ case 42:
1073
903
  switch( (*p) ) {
1074
904
  case 32: goto tr2;
1075
- case 36: goto st54;
1076
- case 95: goto st54;
905
+ case 36: goto st43;
906
+ case 95: goto st43;
1077
907
  }
1078
908
  if ( (*p) < 48 ) {
1079
909
  if ( 45 <= (*p) && (*p) <= 46 )
1080
- goto st54;
910
+ goto st43;
1081
911
  } else if ( (*p) > 57 ) {
1082
912
  if ( 65 <= (*p) && (*p) <= 90 )
1083
- goto st54;
913
+ goto st43;
1084
914
  } else
1085
- goto st54;
915
+ goto st43;
1086
916
  goto st0;
1087
- st54:
917
+ st43:
1088
918
  if ( ++p == pe )
1089
- goto _test_eof54;
1090
- case 54:
919
+ goto _test_eof43;
920
+ case 43:
1091
921
  switch( (*p) ) {
1092
922
  case 32: goto tr2;
1093
- case 36: goto st55;
1094
- case 95: goto st55;
923
+ case 36: goto st44;
924
+ case 95: goto st44;
1095
925
  }
1096
926
  if ( (*p) < 48 ) {
1097
927
  if ( 45 <= (*p) && (*p) <= 46 )
1098
- goto st55;
928
+ goto st44;
1099
929
  } else if ( (*p) > 57 ) {
1100
930
  if ( 65 <= (*p) && (*p) <= 90 )
1101
- goto st55;
931
+ goto st44;
1102
932
  } else
1103
- goto st55;
933
+ goto st44;
1104
934
  goto st0;
1105
- st55:
935
+ st44:
1106
936
  if ( ++p == pe )
1107
- goto _test_eof55;
1108
- case 55:
937
+ goto _test_eof44;
938
+ case 44:
1109
939
  switch( (*p) ) {
1110
940
  case 32: goto tr2;
1111
- case 36: goto st56;
1112
- case 95: goto st56;
941
+ case 36: goto st45;
942
+ case 95: goto st45;
1113
943
  }
1114
944
  if ( (*p) < 48 ) {
1115
945
  if ( 45 <= (*p) && (*p) <= 46 )
1116
- goto st56;
946
+ goto st45;
1117
947
  } else if ( (*p) > 57 ) {
1118
948
  if ( 65 <= (*p) && (*p) <= 90 )
1119
- goto st56;
949
+ goto st45;
1120
950
  } else
1121
- goto st56;
951
+ goto st45;
1122
952
  goto st0;
1123
- st56:
953
+ st45:
1124
954
  if ( ++p == pe )
1125
- goto _test_eof56;
1126
- case 56:
955
+ goto _test_eof45;
956
+ case 45:
1127
957
  if ( (*p) == 32 )
1128
958
  goto tr2;
1129
959
  goto st0;
@@ -1143,7 +973,7 @@ case 56:
1143
973
  _test_eof14: cs = 14; goto _test_eof;
1144
974
  _test_eof15: cs = 15; goto _test_eof;
1145
975
  _test_eof16: cs = 16; goto _test_eof;
1146
- _test_eof57: cs = 57; goto _test_eof;
976
+ _test_eof46: cs = 46; goto _test_eof;
1147
977
  _test_eof17: cs = 17; goto _test_eof;
1148
978
  _test_eof18: cs = 18; goto _test_eof;
1149
979
  _test_eof19: cs = 19; goto _test_eof;
@@ -1173,23 +1003,12 @@ case 56:
1173
1003
  _test_eof43: cs = 43; goto _test_eof;
1174
1004
  _test_eof44: cs = 44; goto _test_eof;
1175
1005
  _test_eof45: cs = 45; goto _test_eof;
1176
- _test_eof46: cs = 46; goto _test_eof;
1177
- _test_eof47: cs = 47; goto _test_eof;
1178
- _test_eof48: cs = 48; goto _test_eof;
1179
- _test_eof49: cs = 49; goto _test_eof;
1180
- _test_eof50: cs = 50; goto _test_eof;
1181
- _test_eof51: cs = 51; goto _test_eof;
1182
- _test_eof52: cs = 52; goto _test_eof;
1183
- _test_eof53: cs = 53; goto _test_eof;
1184
- _test_eof54: cs = 54; goto _test_eof;
1185
- _test_eof55: cs = 55; goto _test_eof;
1186
- _test_eof56: cs = 56; goto _test_eof;
1187
1006
 
1188
1007
  _test_eof: {}
1189
1008
  _out: {}
1190
1009
  }
1191
1010
 
1192
- #line 114 "ext/http11/http11_parser.rl"
1011
+ #line 115 "ext/puma_http11/http11_parser.rl"
1193
1012
 
1194
1013
  if (!puma_parser_has_error(parser))
1195
1014
  parser->cs = cs;