puma 5.6.4 → 6.4.2

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 (85) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +372 -6
  3. data/LICENSE +0 -0
  4. data/README.md +79 -29
  5. data/bin/puma-wild +1 -1
  6. data/docs/architecture.md +0 -0
  7. data/docs/compile_options.md +34 -0
  8. data/docs/deployment.md +0 -0
  9. data/docs/fork_worker.md +1 -3
  10. data/docs/images/puma-connection-flow-no-reactor.png +0 -0
  11. data/docs/images/puma-connection-flow.png +0 -0
  12. data/docs/images/puma-general-arch.png +0 -0
  13. data/docs/jungle/README.md +0 -0
  14. data/docs/jungle/rc.d/README.md +0 -0
  15. data/docs/jungle/rc.d/puma.conf +0 -0
  16. data/docs/kubernetes.md +12 -0
  17. data/docs/nginx.md +1 -1
  18. data/docs/plugins.md +0 -0
  19. data/docs/rails_dev_mode.md +0 -0
  20. data/docs/restart.md +1 -0
  21. data/docs/signals.md +0 -0
  22. data/docs/stats.md +0 -0
  23. data/docs/systemd.md +3 -6
  24. data/docs/testing_benchmarks_local_files.md +150 -0
  25. data/docs/testing_test_rackup_ci_files.md +36 -0
  26. data/ext/puma_http11/PumaHttp11Service.java +0 -0
  27. data/ext/puma_http11/ext_help.h +0 -0
  28. data/ext/puma_http11/extconf.rb +22 -10
  29. data/ext/puma_http11/http11_parser.c +1 -1
  30. data/ext/puma_http11/http11_parser.h +1 -1
  31. data/ext/puma_http11/http11_parser.java.rl +2 -2
  32. data/ext/puma_http11/http11_parser.rl +2 -2
  33. data/ext/puma_http11/http11_parser_common.rl +2 -2
  34. data/ext/puma_http11/mini_ssl.c +153 -27
  35. data/ext/puma_http11/no_ssl/PumaHttp11Service.java +0 -0
  36. data/ext/puma_http11/org/jruby/puma/Http11.java +3 -3
  37. data/ext/puma_http11/org/jruby/puma/Http11Parser.java +1 -1
  38. data/ext/puma_http11/org/jruby/puma/MiniSSL.java +167 -65
  39. data/ext/puma_http11/puma_http11.c +17 -9
  40. data/lib/puma/app/status.rb +7 -4
  41. data/lib/puma/binder.rb +51 -54
  42. data/lib/puma/cli.rb +16 -18
  43. data/lib/puma/client.rb +100 -26
  44. data/lib/puma/cluster/worker.rb +18 -11
  45. data/lib/puma/cluster/worker_handle.rb +4 -1
  46. data/lib/puma/cluster.rb +102 -40
  47. data/lib/puma/commonlogger.rb +21 -14
  48. data/lib/puma/configuration.rb +77 -59
  49. data/lib/puma/const.rb +129 -92
  50. data/lib/puma/control_cli.rb +33 -23
  51. data/lib/puma/detect.rb +7 -4
  52. data/lib/puma/dsl.rb +251 -53
  53. data/lib/puma/error_logger.rb +18 -9
  54. data/lib/puma/events.rb +6 -126
  55. data/lib/puma/io_buffer.rb +39 -4
  56. data/lib/puma/jruby_restart.rb +2 -1
  57. data/lib/puma/json_serialization.rb +0 -0
  58. data/lib/puma/launcher/bundle_pruner.rb +104 -0
  59. data/lib/puma/launcher.rb +113 -175
  60. data/lib/puma/log_writer.rb +147 -0
  61. data/lib/puma/minissl/context_builder.rb +26 -12
  62. data/lib/puma/minissl.rb +113 -15
  63. data/lib/puma/null_io.rb +21 -2
  64. data/lib/puma/plugin/systemd.rb +90 -0
  65. data/lib/puma/plugin/tmp_restart.rb +1 -1
  66. data/lib/puma/plugin.rb +0 -0
  67. data/lib/puma/rack/builder.rb +6 -6
  68. data/lib/puma/rack/urlmap.rb +1 -1
  69. data/lib/puma/rack_default.rb +19 -4
  70. data/lib/puma/reactor.rb +19 -10
  71. data/lib/puma/request.rb +365 -166
  72. data/lib/puma/runner.rb +56 -20
  73. data/lib/puma/sd_notify.rb +149 -0
  74. data/lib/puma/server.rb +137 -87
  75. data/lib/puma/single.rb +13 -11
  76. data/lib/puma/state_file.rb +4 -6
  77. data/lib/puma/thread_pool.rb +57 -19
  78. data/lib/puma/util.rb +12 -14
  79. data/lib/puma.rb +12 -11
  80. data/lib/rack/handler/puma.rb +113 -86
  81. data/tools/Dockerfile +2 -2
  82. data/tools/trickletest.rb +0 -0
  83. metadata +11 -6
  84. data/lib/puma/queue_close.rb +0 -26
  85. data/lib/puma/systemd.rb +0 -46
@@ -297,7 +297,7 @@ case 13:
297
297
  tr18:
298
298
  #line 65 "ext/puma_http11/http11_parser.rl"
299
299
  {
300
- parser->http_version(parser, PTR_TO(mark), LEN(mark, p));
300
+ parser->server_protocol(parser, PTR_TO(mark), LEN(mark, p));
301
301
  }
302
302
  goto st14;
303
303
  tr26:
@@ -46,7 +46,7 @@ typedef struct puma_parser {
46
46
  element_cb fragment;
47
47
  element_cb request_path;
48
48
  element_cb query_string;
49
- element_cb http_version;
49
+ element_cb server_protocol;
50
50
  element_cb header_done;
51
51
 
52
52
  char buf[BUFFER_LEN];
@@ -39,8 +39,8 @@ public class Http11Parser {
39
39
  Http11.query_string(runtime, parser.data, parser.buffer, parser.query_start, fpc-parser.query_start);
40
40
  }
41
41
 
42
- action http_version {
43
- Http11.http_version(runtime, parser.data, parser.buffer, parser.mark, fpc-parser.mark);
42
+ action server_protocol {
43
+ Http11.server_protocol(runtime, parser.data, parser.buffer, parser.mark, fpc-parser.mark);
44
44
  }
45
45
 
46
46
  action request_path {
@@ -62,8 +62,8 @@ static void snake_upcase_char(char *c)
62
62
  parser->query_string(parser, PTR_TO(query_start), LEN(query_start, fpc));
63
63
  }
64
64
 
65
- action http_version {
66
- parser->http_version(parser, PTR_TO(mark), LEN(mark, fpc));
65
+ action server_protocol {
66
+ parser->server_protocol(parser, PTR_TO(mark), LEN(mark, fpc));
67
67
  }
68
68
 
69
69
  action request_path {
@@ -38,8 +38,8 @@
38
38
  Method = ( upper | digit | safe ){1,20} >mark %request_method;
39
39
 
40
40
  http_number = ( digit+ "." digit+ ) ;
41
- HTTP_Version = ( "HTTP/" http_number ) >mark %http_version ;
42
- Request_Line = ( Method " " Request_URI ("#" Fragment){0,1} " " HTTP_Version CRLF ) ;
41
+ Server_Protocol = ( "HTTP/" http_number ) >mark %server_protocol ;
42
+ Request_Line = ( Method " " Request_URI ("#" Fragment){0,1} " " Server_Protocol CRLF ) ;
43
43
 
44
44
  field_name = ( token -- ":" )+ >start_field $snake_upcase_field %write_field;
45
45
 
@@ -30,6 +30,18 @@ typedef struct {
30
30
 
31
31
  VALUE eError;
32
32
 
33
+ NORETURN(void raise_file_error(const char* caller, const char *filename));
34
+
35
+ void raise_file_error(const char* caller, const char *filename) {
36
+ rb_raise(eError, "%s: error in file '%s': %s", caller, filename, ERR_error_string(ERR_get_error(), NULL));
37
+ }
38
+
39
+ NORETURN(void raise_param_error(const char* caller, const char *param));
40
+
41
+ void raise_param_error(const char* caller, const char *param) {
42
+ rb_raise(eError, "%s: error with parameter '%s': %s", caller, param, ERR_error_string(ERR_get_error(), NULL));
43
+ }
44
+
33
45
  void engine_free(void *ptr) {
34
46
  ms_conn *conn = ptr;
35
47
  ms_cert_buf* cert_buf = (ms_cert_buf*)SSL_get_app_data(conn->ssl);
@@ -49,7 +61,7 @@ const rb_data_type_t engine_data_type = {
49
61
  0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
50
62
  };
51
63
 
52
- #ifndef HAVE_SSL_GET1_PEER_CERTIFICATE
64
+ #ifndef HAVE_SSL_CTX_SET_DH_AUTO
53
65
  DH *get_dh2048(void) {
54
66
  /* `openssl dhparam -C 2048`
55
67
  * -----BEGIN DH PARAMETERS-----
@@ -92,13 +104,13 @@ DH *get_dh2048(void) {
92
104
  static unsigned char dh2048_g[] = { 0x02 };
93
105
 
94
106
  DH *dh;
95
- #if !(OPENSSL_VERSION_NUMBER < 0x10100005L || defined(LIBRESSL_VERSION_NUMBER))
107
+ #if !(OPENSSL_VERSION_NUMBER < 0x10100005L)
96
108
  BIGNUM *p, *g;
97
109
  #endif
98
110
 
99
111
  dh = DH_new();
100
112
 
101
- #if OPENSSL_VERSION_NUMBER < 0x10100005L || defined(LIBRESSL_VERSION_NUMBER)
113
+ #if OPENSSL_VERSION_NUMBER < 0x10100005L
102
114
  dh->p = BN_bin2bn(dh2048_p, sizeof(dh2048_p), NULL);
103
115
  dh->g = BN_bin2bn(dh2048_g, sizeof(dh2048_g), NULL);
104
116
 
@@ -179,6 +191,18 @@ static int engine_verify_callback(int preverify_ok, X509_STORE_CTX* ctx) {
179
191
  return preverify_ok;
180
192
  }
181
193
 
194
+ static int password_callback(char *buf, int size, int rwflag, void *userdata) {
195
+ const char *password = (const char *) userdata;
196
+ size_t len = strlen(password);
197
+
198
+ if (len > (size_t) size) {
199
+ return 0;
200
+ }
201
+
202
+ memcpy(buf, password, len);
203
+ return (int) len;
204
+ }
205
+
182
206
  static VALUE
183
207
  sslctx_alloc(VALUE klass) {
184
208
  SSL_CTX *ctx;
@@ -204,28 +228,35 @@ sslctx_alloc(VALUE klass) {
204
228
  VALUE
205
229
  sslctx_initialize(VALUE self, VALUE mini_ssl_ctx) {
206
230
  SSL_CTX* ctx;
207
-
231
+ int ssl_options;
232
+ VALUE key, cert, ca, verify_mode, ssl_cipher_filter, no_tlsv1, no_tlsv1_1,
233
+ verification_flags, session_id_bytes, cert_pem, key_pem, key_password_command, key_password;
234
+ BIO *bio;
235
+ X509 *x509 = NULL;
236
+ EVP_PKEY *pkey;
237
+ pem_password_cb *password_cb = NULL;
238
+ const char *password = NULL;
208
239
  #ifdef HAVE_SSL_CTX_SET_MIN_PROTO_VERSION
209
240
  int min;
210
241
  #endif
211
- int ssl_options;
212
- VALUE key, cert, ca, verify_mode, ssl_cipher_filter, no_tlsv1, no_tlsv1_1,
213
- verification_flags, session_id_bytes, cert_pem, key_pem;
214
- #ifndef HAVE_SSL_GET1_PEER_CERTIFICATE
242
+ #ifndef HAVE_SSL_CTX_SET_DH_AUTO
215
243
  DH *dh;
216
244
  #endif
217
- BIO *bio;
218
- X509 *x509;
219
- EVP_PKEY *pkey;
220
-
221
245
  #if OPENSSL_VERSION_NUMBER < 0x10002000L
222
246
  EC_KEY *ecdh;
223
247
  #endif
248
+ #ifdef HAVE_SSL_CTX_SET_SESSION_CACHE_MODE
249
+ VALUE reuse, reuse_cache_size, reuse_timeout;
224
250
 
225
- TypedData_Get_Struct(self, SSL_CTX, &sslctx_type, ctx);
251
+ reuse = rb_funcall(mini_ssl_ctx, rb_intern_const("reuse"), 0);
252
+ reuse_cache_size = rb_funcall(mini_ssl_ctx, rb_intern_const("reuse_cache_size"), 0);
253
+ reuse_timeout = rb_funcall(mini_ssl_ctx, rb_intern_const("reuse_timeout"), 0);
254
+ #endif
226
255
 
227
256
  key = rb_funcall(mini_ssl_ctx, rb_intern_const("key"), 0);
228
257
 
258
+ key_password_command = rb_funcall(mini_ssl_ctx, rb_intern_const("key_password_command"), 0);
259
+
229
260
  cert = rb_funcall(mini_ssl_ctx, rb_intern_const("cert"), 0);
230
261
 
231
262
  ca = rb_funcall(mini_ssl_ctx, rb_intern_const("ca"), 0);
@@ -242,30 +273,109 @@ sslctx_initialize(VALUE self, VALUE mini_ssl_ctx) {
242
273
 
243
274
  no_tlsv1_1 = rb_funcall(mini_ssl_ctx, rb_intern_const("no_tlsv1_1"), 0);
244
275
 
276
+ TypedData_Get_Struct(self, SSL_CTX, &sslctx_type, ctx);
277
+
245
278
  if (!NIL_P(cert)) {
246
279
  StringValue(cert);
247
- SSL_CTX_use_certificate_chain_file(ctx, RSTRING_PTR(cert));
280
+
281
+ if (SSL_CTX_use_certificate_chain_file(ctx, RSTRING_PTR(cert)) != 1) {
282
+ raise_file_error("SSL_CTX_use_certificate_chain_file", RSTRING_PTR(cert));
283
+ }
284
+ }
285
+
286
+ if (!NIL_P(key_password_command)) {
287
+ key_password = rb_funcall(mini_ssl_ctx, rb_intern_const("key_password"), 0);
288
+
289
+ if (!NIL_P(key_password)) {
290
+ StringValue(key_password);
291
+ password_cb = password_callback;
292
+ password = RSTRING_PTR(key_password);
293
+ SSL_CTX_set_default_passwd_cb(ctx, password_cb);
294
+ SSL_CTX_set_default_passwd_cb_userdata(ctx, (void *) password);
295
+ }
248
296
  }
249
297
 
250
298
  if (!NIL_P(key)) {
251
299
  StringValue(key);
252
- SSL_CTX_use_PrivateKey_file(ctx, RSTRING_PTR(key), SSL_FILETYPE_PEM);
300
+
301
+ if (SSL_CTX_use_PrivateKey_file(ctx, RSTRING_PTR(key), SSL_FILETYPE_PEM) != 1) {
302
+ raise_file_error("SSL_CTX_use_PrivateKey_file", RSTRING_PTR(key));
303
+ }
253
304
  }
254
305
 
255
306
  if (!NIL_P(cert_pem)) {
307
+ X509 *ca = NULL;
308
+ unsigned long err;
309
+
256
310
  bio = BIO_new(BIO_s_mem());
257
311
  BIO_puts(bio, RSTRING_PTR(cert_pem));
312
+
313
+ /**
314
+ * Much of this pulled as a simplified version of the `use_certificate_chain_file` method
315
+ * from openssl's `ssl_rsa.c` file.
316
+ */
317
+
318
+ /* first read the cert as the first item in the pem file */
258
319
  x509 = PEM_read_bio_X509(bio, NULL, NULL, NULL);
320
+ if (NULL == x509) {
321
+ BIO_free_all(bio);
322
+ raise_param_error("PEM_read_bio_X509", "cert_pem");
323
+ }
324
+
325
+ /* Add the cert to the context */
326
+ /* 1 is success - otherwise check the error codes */
327
+ if (1 != SSL_CTX_use_certificate(ctx, x509)) {
328
+ BIO_free_all(bio);
329
+ raise_param_error("SSL_CTX_use_certificate", "cert_pem");
330
+ }
331
+
332
+ X509_free(x509); /* no longer need our reference */
333
+
334
+ /* Now lets load up the rest of the certificate chain */
335
+ /* 1 is success 0 is error */
336
+ if (0 == SSL_CTX_clear_chain_certs(ctx)) {
337
+ BIO_free_all(bio);
338
+ raise_param_error("SSL_CTX_clear_chain_certs","cert_pem");
339
+ }
340
+
341
+ while (1) {
342
+ ca = PEM_read_bio_X509(bio, NULL, NULL, NULL);
343
+
344
+ if (NULL == ca) {
345
+ break;
346
+ }
347
+
348
+ if (0 == SSL_CTX_add0_chain_cert(ctx, ca)) {
349
+ BIO_free_all(bio);
350
+ raise_param_error("SSL_CTX_add0_chain_cert","cert_pem");
351
+ }
352
+ /* don't free ca - its now owned by the context */
353
+ }
354
+
355
+ /* ca is NULL - so its either the end of the file or an error */
356
+ err = ERR_peek_last_error();
259
357
 
260
- SSL_CTX_use_certificate(ctx, x509);
358
+ /* If its the end of the file - then we are done, in any case free the bio */
359
+ BIO_free_all(bio);
360
+
361
+ if ((ERR_GET_LIB(err) == ERR_LIB_PEM) && (ERR_GET_REASON(err) == PEM_R_NO_START_LINE)) {
362
+ ERR_clear_error();
363
+ } else {
364
+ raise_param_error("PEM_read_bio_X509","cert_pem");
365
+ }
261
366
  }
262
367
 
263
368
  if (!NIL_P(key_pem)) {
264
369
  bio = BIO_new(BIO_s_mem());
265
370
  BIO_puts(bio, RSTRING_PTR(key_pem));
266
- pkey = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL);
371
+ pkey = PEM_read_bio_PrivateKey(bio, NULL, password_cb, (void *) password);
267
372
 
268
- SSL_CTX_use_PrivateKey(ctx, pkey);
373
+ if (SSL_CTX_use_PrivateKey(ctx, pkey) != 1) {
374
+ BIO_free(bio);
375
+ raise_file_error("SSL_CTX_use_PrivateKey", RSTRING_PTR(key_pem));
376
+ }
377
+ EVP_PKEY_free(pkey);
378
+ BIO_free(bio);
269
379
  }
270
380
 
271
381
  verification_flags = rb_funcall(mini_ssl_ctx, rb_intern_const("verification_flags"), 0);
@@ -278,7 +388,9 @@ sslctx_initialize(VALUE self, VALUE mini_ssl_ctx) {
278
388
 
279
389
  if (!NIL_P(ca)) {
280
390
  StringValue(ca);
281
- SSL_CTX_load_verify_locations(ctx, RSTRING_PTR(ca), NULL);
391
+ if (SSL_CTX_load_verify_locations(ctx, RSTRING_PTR(ca), NULL) != 1) {
392
+ raise_file_error("SSL_CTX_load_verify_locations", RSTRING_PTR(ca));
393
+ }
282
394
  }
283
395
 
284
396
  ssl_options = SSL_OP_CIPHER_SERVER_PREFERENCE | SSL_OP_SINGLE_ECDH_USE | SSL_OP_NO_COMPRESSION;
@@ -296,8 +408,6 @@ sslctx_initialize(VALUE self, VALUE mini_ssl_ctx) {
296
408
 
297
409
  SSL_CTX_set_min_proto_version(ctx, min);
298
410
 
299
- SSL_CTX_set_options(ctx, ssl_options);
300
-
301
411
  #else
302
412
  /* As of 1.0.2f, SSL_OP_SINGLE_DH_USE key use is always on */
303
413
  ssl_options |= SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_SINGLE_DH_USE;
@@ -308,10 +418,23 @@ sslctx_initialize(VALUE self, VALUE mini_ssl_ctx) {
308
418
  if(RTEST(no_tlsv1_1)) {
309
419
  ssl_options |= SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1;
310
420
  }
311
- SSL_CTX_set_options(ctx, ssl_options);
312
421
  #endif
313
422
 
314
- SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF);
423
+ #ifdef HAVE_SSL_CTX_SET_SESSION_CACHE_MODE
424
+ if (!NIL_P(reuse)) {
425
+ SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_SERVER);
426
+ if (!NIL_P(reuse_cache_size)) {
427
+ SSL_CTX_sess_set_cache_size(ctx, NUM2INT(reuse_cache_size));
428
+ }
429
+ if (!NIL_P(reuse_timeout)) {
430
+ SSL_CTX_set_timeout(ctx, NUM2INT(reuse_timeout));
431
+ }
432
+ } else {
433
+ SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF);
434
+ }
435
+ #endif
436
+
437
+ SSL_CTX_set_options(ctx, ssl_options);
315
438
 
316
439
  if (!NIL_P(ssl_cipher_filter)) {
317
440
  StringValue(ssl_cipher_filter);
@@ -322,8 +445,7 @@ sslctx_initialize(VALUE self, VALUE mini_ssl_ctx) {
322
445
  }
323
446
 
324
447
  #if OPENSSL_VERSION_NUMBER < 0x10002000L
325
- // Remove this case if OpenSSL 1.0.1 (now EOL) support is no
326
- // longer needed.
448
+ // Remove this case if OpenSSL 1.0.1 (now EOL) support is no longer needed.
327
449
  ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
328
450
  if (ecdh) {
329
451
  SSL_CTX_set_tmp_ecdh(ctx, ecdh);
@@ -355,7 +477,7 @@ sslctx_initialize(VALUE self, VALUE mini_ssl_ctx) {
355
477
 
356
478
  // printf("\ninitialize end security_level %d\n", SSL_CTX_get_security_level(ctx));
357
479
 
358
- #ifdef HAVE_SSL_GET1_PEER_CERTIFICATE
480
+ #ifdef HAVE_SSL_CTX_SET_DH_AUTO
359
481
  // https://www.openssl.org/docs/man3.0/man3/SSL_CTX_set_dh_auto.html
360
482
  SSL_CTX_set_dh_auto(ctx, 1);
361
483
  #else
@@ -424,7 +546,7 @@ NORETURN(void raise_error(SSL* ssl, int result));
424
546
 
425
547
  void raise_error(SSL* ssl, int result) {
426
548
  char buf[512];
427
- char msg[512];
549
+ char msg[768];
428
550
  const char* err_str;
429
551
  int err = errno;
430
552
  int mask = 4095;
@@ -682,6 +804,10 @@ void Init_mini_ssl(VALUE puma) {
682
804
 
683
805
  rb_define_method(eng, "init?", engine_init, 0);
684
806
 
807
+ /* @!attribute [r] peercert
808
+ * Returns `nil` when `MiniSSL::Context#verify_mode` is set to `VERIFY_NONE`.
809
+ * @return [String, nil] DER encoded cert
810
+ */
685
811
  rb_define_method(eng, "peercert", engine_peercert, 0);
686
812
 
687
813
  rb_define_method(eng, "ssl_vers_st", engine_ssl_vers_st, 0);
File without changes
@@ -46,7 +46,7 @@ public class Http11 extends RubyObject {
46
46
  public static final ByteList FRAGMENT_BYTELIST = new ByteList(ByteList.plain("FRAGMENT"));
47
47
  public static final ByteList REQUEST_PATH_BYTELIST = new ByteList(ByteList.plain("REQUEST_PATH"));
48
48
  public static final ByteList QUERY_STRING_BYTELIST = new ByteList(ByteList.plain("QUERY_STRING"));
49
- public static final ByteList HTTP_VERSION_BYTELIST = new ByteList(ByteList.plain("HTTP_VERSION"));
49
+ public static final ByteList SERVER_PROTOCOL_BYTELIST = new ByteList(ByteList.plain("SERVER_PROTOCOL"));
50
50
 
51
51
  private static ObjectAllocator ALLOCATOR = new ObjectAllocator() {
52
52
  public IRubyObject allocate(Ruby runtime, RubyClass klass) {
@@ -153,9 +153,9 @@ public class Http11 extends RubyObject {
153
153
  req.fastASet(RubyString.newStringShared(runtime, QUERY_STRING_BYTELIST),val);
154
154
  }
155
155
 
156
- public static void http_version(Ruby runtime, RubyHash req, ByteList buffer, int at, int length) {
156
+ public static void server_protocol(Ruby runtime, RubyHash req, ByteList buffer, int at, int length) {
157
157
  RubyString val = RubyString.newString(runtime,new ByteList(buffer,at,length));
158
- req.fastASet(RubyString.newStringShared(runtime, HTTP_VERSION_BYTELIST),val);
158
+ req.fastASet(RubyString.newStringShared(runtime, SERVER_PROTOCOL_BYTELIST),val);
159
159
  }
160
160
 
161
161
  public void header_done(Ruby runtime, RubyHash req, ByteList buffer, int at, int length) {
@@ -383,7 +383,7 @@ case 1:
383
383
  case 11:
384
384
  // line 42 "ext/puma_http11/http11_parser.java.rl"
385
385
  {
386
- Http11.http_version(runtime, parser.data, parser.buffer, parser.mark, p-parser.mark);
386
+ Http11.server_protocol(runtime, parser.data, parser.buffer, parser.mark, p-parser.mark);
387
387
  }
388
388
  break;
389
389
  case 12: