fcgi 0.9.2 → 0.9.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/ext/fcgi/fcgi.c +30 -4
- data/fcgi.gemspec +4 -3
- data/lib/fcgi.rb +3 -4
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bb36e2d30016bac819a6aec9d30890bcca7750ec82862e099f89ae341049ed7c
|
4
|
+
data.tar.gz: af9e34e45aa8cb7673f721439e765e82e31ed8fd910987d294801335ce17fa0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79f085764709841d49d4c6e91fc8188a5ba952a7e11f544addde2602d7a8e325bc346613d6c12bf3ade8cb09e0269d79c28a49a71ed369ef833542c3da2ff736
|
7
|
+
data.tar.gz: 0c02df774067bab5dcc11f065bee1f55e941900f5602ce60deceef24df78c1588cbefd1cae67926d3335c4e1aa1e360c25ffc3c2daeffe19e973ee5f9b98d912
|
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.2
|
1
|
+
0.9.2.1
|
data/ext/fcgi/fcgi.c
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
* fcgi.c
|
3
3
|
* Copyright (C) 1998-1999 Network Applied Communication Laboratory, Inc.
|
4
4
|
* Copyright (C) 2002-2006 MoonWolf <moonwolf@moonwolf.com>
|
5
|
+
* Copyright (C) 2012-2014 mva <mva@mva.name>
|
5
6
|
*/
|
6
7
|
|
7
8
|
#include <stdio.h>
|
@@ -11,6 +12,9 @@
|
|
11
12
|
#include <fcntl.h>
|
12
13
|
|
13
14
|
#include "ruby.h"
|
15
|
+
#ifdef HAVE_RUBY_VERSION_H
|
16
|
+
#include "ruby/version.h"
|
17
|
+
#endif
|
14
18
|
|
15
19
|
#ifndef RSTRING_PTR
|
16
20
|
#define RSTRING_PTR(str) (RSTRING(str)->ptr)
|
@@ -77,7 +81,7 @@ static VALUE fcgi_s_accept(VALUE self)
|
|
77
81
|
{
|
78
82
|
int status;
|
79
83
|
FCGX_Request *req;
|
80
|
-
|
84
|
+
rb_fdset_t readfds;
|
81
85
|
|
82
86
|
req = ALLOC(FCGX_Request);
|
83
87
|
|
@@ -87,9 +91,9 @@ static VALUE fcgi_s_accept(VALUE self)
|
|
87
91
|
return Qnil;
|
88
92
|
}
|
89
93
|
|
90
|
-
|
91
|
-
|
92
|
-
if (
|
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) {
|
93
97
|
return Qnil;
|
94
98
|
}
|
95
99
|
|
@@ -261,7 +265,9 @@ static VALUE fcgi_stream_putc(VALUE self, VALUE ch)
|
|
261
265
|
FCGX_Stream *stream;
|
262
266
|
int c;
|
263
267
|
|
268
|
+
#if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
|
264
269
|
rb_secure(4);
|
270
|
+
#endif
|
265
271
|
Data_Get_Stream(self, stream);
|
266
272
|
if ((c = FCGX_PutChar(NUM2INT(ch), stream)) == EOF)
|
267
273
|
CHECK_STREAM_ERROR(stream);
|
@@ -273,7 +279,9 @@ static VALUE fcgi_stream_write(VALUE self, VALUE str)
|
|
273
279
|
FCGX_Stream *stream;
|
274
280
|
int len;
|
275
281
|
|
282
|
+
#if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
|
276
283
|
rb_secure(4);
|
284
|
+
#endif
|
277
285
|
Data_Get_Stream(self, stream);
|
278
286
|
str = rb_obj_as_string(str);
|
279
287
|
len = FCGX_PutStr(RSTRING_PTR(str), RSTRING_LEN(str), stream);
|
@@ -406,9 +414,11 @@ static VALUE fcgi_stream_ungetc(VALUE self, VALUE ch)
|
|
406
414
|
FCGX_Stream *stream;
|
407
415
|
int c;
|
408
416
|
|
417
|
+
#if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
|
409
418
|
if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
|
410
419
|
rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
|
411
420
|
}
|
421
|
+
#endif
|
412
422
|
Data_Get_Stream(self, stream);
|
413
423
|
c = FCGX_UnGetChar(NUM2INT(ch), stream);
|
414
424
|
CHECK_STREAM_ERROR(stream);
|
@@ -421,9 +431,11 @@ static VALUE fcgi_stream_gets(VALUE self) {
|
|
421
431
|
VALUE str = rb_str_new(0,0);
|
422
432
|
OBJ_TAINT(str);
|
423
433
|
|
434
|
+
#if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
|
424
435
|
if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
|
425
436
|
rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
|
426
437
|
}
|
438
|
+
#endif
|
427
439
|
|
428
440
|
Data_Get_Stream(self, stream);
|
429
441
|
|
@@ -448,9 +460,11 @@ static VALUE fcgi_stream_read(int argc, VALUE *argv, VALUE self)
|
|
448
460
|
char *buff;
|
449
461
|
int n;
|
450
462
|
|
463
|
+
#if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
|
451
464
|
if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
|
452
465
|
rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
|
453
466
|
}
|
467
|
+
#endif
|
454
468
|
|
455
469
|
Data_Get_Stream(self, stream);
|
456
470
|
|
@@ -501,9 +515,11 @@ static VALUE fcgi_stream_eof(VALUE self)
|
|
501
515
|
{
|
502
516
|
FCGX_Stream *stream;
|
503
517
|
|
518
|
+
#if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
|
504
519
|
if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
|
505
520
|
rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
|
506
521
|
}
|
522
|
+
#endif
|
507
523
|
Data_Get_Stream(self, stream);
|
508
524
|
return FCGX_HasSeenEOF(stream) ? Qtrue : Qfalse;
|
509
525
|
}
|
@@ -512,9 +528,11 @@ static VALUE fcgi_stream_close(VALUE self)
|
|
512
528
|
{
|
513
529
|
FCGX_Stream *stream;
|
514
530
|
|
531
|
+
#if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
|
515
532
|
if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
|
516
533
|
rb_raise(rb_eSecurityError, "Insecure: can't close");
|
517
534
|
}
|
535
|
+
#endif
|
518
536
|
Data_Get_Stream(self, stream);
|
519
537
|
if (FCGX_FClose(stream) == EOF)
|
520
538
|
CHECK_STREAM_ERROR(stream);
|
@@ -531,33 +549,41 @@ static VALUE fcgi_stream_closed(VALUE self)
|
|
531
549
|
|
532
550
|
static VALUE fcgi_stream_binmode(VALUE self)
|
533
551
|
{
|
552
|
+
#if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
|
534
553
|
if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
|
535
554
|
rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
|
536
555
|
}
|
556
|
+
#endif
|
537
557
|
return self;
|
538
558
|
}
|
539
559
|
|
540
560
|
static VALUE fcgi_stream_isatty(VALUE self)
|
541
561
|
{
|
562
|
+
#if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
|
542
563
|
if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
|
543
564
|
rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
|
544
565
|
}
|
566
|
+
#endif
|
545
567
|
return Qfalse;
|
546
568
|
}
|
547
569
|
|
548
570
|
static VALUE fcgi_stream_sync(VALUE self)
|
549
571
|
{
|
572
|
+
#if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
|
550
573
|
if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
|
551
574
|
rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
|
552
575
|
}
|
576
|
+
#endif
|
553
577
|
return Qfalse;
|
554
578
|
}
|
555
579
|
|
556
580
|
static VALUE fcgi_stream_setsync(VALUE self,VALUE sync)
|
557
581
|
{
|
582
|
+
#if !defined(RUBY_API_VERSION_MAJOR) || (RUBY_API_VERSION_MAJOR < 3)
|
558
583
|
if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
|
559
584
|
rb_raise(rb_eSecurityError, "Insecure: operation on untainted IO");
|
560
585
|
}
|
586
|
+
#endif
|
561
587
|
return Qfalse;
|
562
588
|
}
|
563
589
|
|
data/fcgi.gemspec
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{fcgi}
|
3
|
-
s.version = "0.9.2"
|
3
|
+
s.version = "0.9.2.2"
|
4
|
+
s.license = "MIT"
|
4
5
|
|
5
6
|
s.authors = [%q{mva}]
|
6
|
-
s.date = %q{
|
7
|
-
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.}
|
8
9
|
s.email = %q{mva@mva.name}
|
9
10
|
s.extensions = [%q{ext/fcgi/extconf.rb}]
|
10
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,
|
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
|
-
|
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, *
|
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
|
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:
|
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,40 +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
|
-
-
|
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
|
-
licenses:
|
39
|
+
licenses:
|
40
|
+
- MIT
|
40
41
|
metadata: {}
|
41
|
-
post_install_message:
|
42
|
+
post_install_message:
|
42
43
|
rdoc_options:
|
43
|
-
- --charset=UTF-8
|
44
|
+
- "--charset=UTF-8"
|
44
45
|
require_paths:
|
45
46
|
- lib
|
46
47
|
required_ruby_version: !ruby/object:Gem::Requirement
|
47
48
|
requirements:
|
48
|
-
- -
|
49
|
+
- - ">="
|
49
50
|
- !ruby/object:Gem::Version
|
50
51
|
version: '0'
|
51
52
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
53
|
requirements:
|
53
|
-
- -
|
54
|
+
- - ">="
|
54
55
|
- !ruby/object:Gem::Version
|
55
56
|
version: '0'
|
56
57
|
requirements: []
|
57
|
-
|
58
|
-
|
59
|
-
signing_key:
|
58
|
+
rubygems_version: 3.3.8
|
59
|
+
signing_key:
|
60
60
|
specification_version: 4
|
61
61
|
summary: FastCGI library for Ruby.
|
62
62
|
test_files:
|