fcgi 0.9.2.1 → 0.9.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +5 -5
  2. data/ext/fcgi/fcgi.c +29 -4
  3. data/fcgi.gemspec +3 -3
  4. data/lib/fcgi.rb +3 -4
  5. metadata +14 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1387d847e81c0bee272b0fae6c040e24503147b8
4
- data.tar.gz: 71dbe8e5af257cee1c73d0bebc286dc7af86439d
2
+ SHA256:
3
+ metadata.gz: bb36e2d30016bac819a6aec9d30890bcca7750ec82862e099f89ae341049ed7c
4
+ data.tar.gz: af9e34e45aa8cb7673f721439e765e82e31ed8fd910987d294801335ce17fa0d
5
5
  SHA512:
6
- metadata.gz: a2009fff645f8571a4d4e71085b021defab6bc3e7073305fc3d3b08c9ed00261b9e050568df5bcabc93bcebd03dbfa98fb58d8e2055b7c87c57fcf762c638b20
7
- data.tar.gz: fec23575158c5bb3d68c7c483ba27eb6493b97f571c2117213f9a99ec992f80c334b662038252b8e22d5fa8785e9690393cacac55376f1798b993ec368fc647c
6
+ metadata.gz: 79f085764709841d49d4c6e91fc8188a5ba952a7e11f544addde2602d7a8e325bc346613d6c12bf3ade8cb09e0269d79c28a49a71ed369ef833542c3da2ff736
7
+ data.tar.gz: 0c02df774067bab5dcc11f065bee1f55e941900f5602ce60deceef24df78c1588cbefd1cae67926d3335c4e1aa1e360c25ffc3c2daeffe19e973ee5f9b98d912
data/ext/fcgi/fcgi.c CHANGED
@@ -12,6 +12,9 @@
12
12
  #include <fcntl.h>
13
13
 
14
14
  #include "ruby.h"
15
+ #ifdef HAVE_RUBY_VERSION_H
16
+ #include "ruby/version.h"
17
+ #endif
15
18
 
16
19
  #ifndef RSTRING_PTR
17
20
  #define RSTRING_PTR(str) (RSTRING(str)->ptr)
@@ -78,7 +81,7 @@ static VALUE fcgi_s_accept(VALUE self)
78
81
  {
79
82
  int status;
80
83
  FCGX_Request *req;
81
- fd_set readfds;
84
+ rb_fdset_t readfds;
82
85
 
83
86
  req = ALLOC(FCGX_Request);
84
87
 
@@ -88,9 +91,9 @@ static VALUE fcgi_s_accept(VALUE self)
88
91
  return Qnil;
89
92
  }
90
93
 
91
- FD_ZERO(&readfds);
92
- FD_SET(req->listen_sock, &readfds);
93
- if (select(req->listen_sock+1, &readfds, NULL, NULL, NULL) < 1) {
94
+ rb_fd_init(&readfds);
95
+ rb_fd_set(req->listen_sock, &readfds);
96
+ if (rb_thread_fd_select(readfds.maxfd, &readfds, NULL, NULL, NULL) < 1) {
94
97
  return Qnil;
95
98
  }
96
99
 
@@ -262,7 +265,9 @@ static VALUE fcgi_stream_putc(VALUE self, VALUE ch)
262
265
  FCGX_Stream *stream;
263
266
  int c;
264
267
 
268
+ #if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
265
269
  rb_secure(4);
270
+ #endif
266
271
  Data_Get_Stream(self, stream);
267
272
  if ((c = FCGX_PutChar(NUM2INT(ch), stream)) == EOF)
268
273
  CHECK_STREAM_ERROR(stream);
@@ -274,7 +279,9 @@ static VALUE fcgi_stream_write(VALUE self, VALUE str)
274
279
  FCGX_Stream *stream;
275
280
  int len;
276
281
 
282
+ #if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
277
283
  rb_secure(4);
284
+ #endif
278
285
  Data_Get_Stream(self, stream);
279
286
  str = rb_obj_as_string(str);
280
287
  len = FCGX_PutStr(RSTRING_PTR(str), RSTRING_LEN(str), stream);
@@ -407,9 +414,11 @@ static VALUE fcgi_stream_ungetc(VALUE self, VALUE ch)
407
414
  FCGX_Stream *stream;
408
415
  int c;
409
416
 
417
+ #if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
410
418
  if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
411
419
  rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
412
420
  }
421
+ #endif
413
422
  Data_Get_Stream(self, stream);
414
423
  c = FCGX_UnGetChar(NUM2INT(ch), stream);
415
424
  CHECK_STREAM_ERROR(stream);
@@ -422,9 +431,11 @@ static VALUE fcgi_stream_gets(VALUE self) {
422
431
  VALUE str = rb_str_new(0,0);
423
432
  OBJ_TAINT(str);
424
433
 
434
+ #if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
425
435
  if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
426
436
  rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
427
437
  }
438
+ #endif
428
439
 
429
440
  Data_Get_Stream(self, stream);
430
441
 
@@ -449,9 +460,11 @@ static VALUE fcgi_stream_read(int argc, VALUE *argv, VALUE self)
449
460
  char *buff;
450
461
  int n;
451
462
 
463
+ #if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
452
464
  if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
453
465
  rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
454
466
  }
467
+ #endif
455
468
 
456
469
  Data_Get_Stream(self, stream);
457
470
 
@@ -502,9 +515,11 @@ static VALUE fcgi_stream_eof(VALUE self)
502
515
  {
503
516
  FCGX_Stream *stream;
504
517
 
518
+ #if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
505
519
  if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
506
520
  rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
507
521
  }
522
+ #endif
508
523
  Data_Get_Stream(self, stream);
509
524
  return FCGX_HasSeenEOF(stream) ? Qtrue : Qfalse;
510
525
  }
@@ -513,9 +528,11 @@ static VALUE fcgi_stream_close(VALUE self)
513
528
  {
514
529
  FCGX_Stream *stream;
515
530
 
531
+ #if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
516
532
  if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
517
533
  rb_raise(rb_eSecurityError, "Insecure: can't close");
518
534
  }
535
+ #endif
519
536
  Data_Get_Stream(self, stream);
520
537
  if (FCGX_FClose(stream) == EOF)
521
538
  CHECK_STREAM_ERROR(stream);
@@ -532,33 +549,41 @@ static VALUE fcgi_stream_closed(VALUE self)
532
549
 
533
550
  static VALUE fcgi_stream_binmode(VALUE self)
534
551
  {
552
+ #if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
535
553
  if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
536
554
  rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
537
555
  }
556
+ #endif
538
557
  return self;
539
558
  }
540
559
 
541
560
  static VALUE fcgi_stream_isatty(VALUE self)
542
561
  {
562
+ #if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
543
563
  if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
544
564
  rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
545
565
  }
566
+ #endif
546
567
  return Qfalse;
547
568
  }
548
569
 
549
570
  static VALUE fcgi_stream_sync(VALUE self)
550
571
  {
572
+ #if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
551
573
  if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
552
574
  rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
553
575
  }
576
+ #endif
554
577
  return Qfalse;
555
578
  }
556
579
 
557
580
  static VALUE fcgi_stream_setsync(VALUE self,VALUE sync)
558
581
  {
582
+ #if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
559
583
  if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
560
584
  rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
561
585
  }
586
+ #endif
562
587
  return Qfalse;
563
588
  }
564
589
 
data/fcgi.gemspec CHANGED
@@ -1,11 +1,11 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{fcgi}
3
- s.version = "0.9.2.1"
3
+ s.version = "0.9.2.2"
4
4
  s.license = "MIT"
5
5
 
6
6
  s.authors = [%q{mva}]
7
- s.date = %q{2013-09-30}
8
- s.description = %q{FastCGI is a language independent, scalable, open extension to CGI that provides high performance without the limitations of server specific APIs. This version aims to be compatible with both 1.8.x and 1.9.x versions of Ruby, and also will be ported to 2.0.x.}
7
+ s.date = %q{2022-10-17}
8
+ s.description = %q{FastCGI is a language independent, scalable, open extension to CGI that provides high performance without the limitations of server specific APIs. This version aims to be compatible with both 1.8.x and 1.9.x versions of Ruby, and also will be ported to 2.0.x. It has been hacked to work with Ruby 3.0.x.}
9
9
  s.email = %q{mva@mva.name}
10
10
  s.extensions = [%q{ext/fcgi/extconf.rb}]
11
11
  s.extra_rdoc_files = [
data/lib/fcgi.rb CHANGED
@@ -115,7 +115,7 @@ rescue LoadError # Load the pure ruby version instead
115
115
  end
116
116
 
117
117
  def session
118
- sock, addr = *@server.accept
118
+ sock, _ = *@server.accept
119
119
  return unless sock
120
120
  fsock = FastCGISocket.new(sock)
121
121
  req = next_request(fsock)
@@ -196,7 +196,7 @@ rescue LoadError # Load the pure ruby version instead
196
196
  def read_record
197
197
  header = @socket.read(Record::HEADER_LENGTH) or return nil
198
198
  return nil unless header.size == Record::HEADER_LENGTH
199
- version, type, reqid, clen, padlen, reserved = *Record.parse_header(header)
199
+ _, type, reqid, clen, padlen, _ = *Record.parse_header(header)
200
200
  Record.class_for(type).parse(reqid, read_record_body(clen, padlen))
201
201
  end
202
202
 
@@ -356,7 +356,7 @@ rescue LoadError # Load the pure ruby version instead
356
356
  BODY_FORMAT = 'nCC5'
357
357
 
358
358
  def BeginRequestRecord.parse(id, body)
359
- role, flags, *reserved = *body.unpack(BODY_FORMAT)
359
+ role, flags, *_ = *body.unpack(BODY_FORMAT)
360
360
  new(id, role, flags)
361
361
  end
362
362
 
@@ -626,7 +626,6 @@ class FCGI
626
626
  if FCGI::is_cgi?
627
627
  yield ::CGI.new(*args)
628
628
  else
629
- exit_requested = false
630
629
  FCGI::each do |request|
631
630
 
632
631
  $stdout, $stderr = request.out, request.err
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fcgi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2.1
4
+ version: 0.9.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - mva
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-30 00:00:00.000000000 Z
11
+ date: 2022-10-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: FastCGI is a language independent, scalable, open extension to CGI that
14
14
  provides high performance without the limitations of server specific APIs. This
15
15
  version aims to be compatible with both 1.8.x and 1.9.x versions of Ruby, and also
16
- will be ported to 2.0.x.
16
+ will be ported to 2.0.x. It has been hacked to work with Ruby 3.0.x.
17
17
  email: mva@mva.name
18
18
  executables: []
19
19
  extensions:
@@ -23,41 +23,40 @@ extra_rdoc_files:
23
23
  - README.rdoc
24
24
  - README.signals
25
25
  files:
26
+ - LICENSE
27
+ - README.rdoc
28
+ - README.signals
26
29
  - VERSION
27
30
  - ext/fcgi/MANIFEST
28
31
  - ext/fcgi/Makefile
29
32
  - ext/fcgi/extconf.rb
30
33
  - ext/fcgi/fcgi.c
31
- - lib/fcgi.rb
32
34
  - fcgi.gemspec
33
- - LICENSE
34
- - README.rdoc
35
- - README.signals
35
+ - lib/fcgi.rb
36
36
  - test/helper.rb
37
37
  - test/test_fcgi.rb
38
38
  homepage: http://github.com/alphallc/ruby-fcgi-ng
39
39
  licenses:
40
40
  - MIT
41
41
  metadata: {}
42
- post_install_message:
42
+ post_install_message:
43
43
  rdoc_options:
44
- - --charset=UTF-8
44
+ - "--charset=UTF-8"
45
45
  require_paths:
46
46
  - lib
47
47
  required_ruby_version: !ruby/object:Gem::Requirement
48
48
  requirements:
49
- - - '>='
49
+ - - ">="
50
50
  - !ruby/object:Gem::Version
51
51
  version: '0'
52
52
  required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - '>='
54
+ - - ">="
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
57
  requirements: []
58
- rubyforge_project:
59
- rubygems_version: 2.0.3
60
- signing_key:
58
+ rubygems_version: 3.3.8
59
+ signing_key:
61
60
  specification_version: 4
62
61
  summary: FastCGI library for Ruby.
63
62
  test_files: