class FCGI::Record
Constants
- HEADER_FORMAT
-
uint8_t protocol_version; uint8_t record_type; uint16_t
request_id
; (big endian) uint16_t content_length; (big endian) uint8_t padding_length; uint8_t reserved; - HEADER_LENGTH
- RECORD_CLASS
Attributes
Public Class Methods
Source
# File lib/fcgi.rb, line 318 def self.class_for(type) RECORD_CLASS[type] end
Source
# File lib/fcgi.rb, line 322 def initialize(type, reqid) @type = type @request_id = reqid end
Source
# File lib/fcgi.rb, line 314 def self.parse_header(buf) return *buf.unpack(HEADER_FORMAT) end
Public Instance Methods
Source
# File lib/fcgi.rb, line 334 def management_record? @request_id == FCGI_NULL_REQUEST_ID end
Source
# File lib/fcgi.rb, line 338 def serialize body = make_body() padlen = body.length % 8 header = make_header(body.length, padlen) header + body + "\000" * padlen end
Private Instance Methods
Source
# File lib/fcgi.rb, line 347 def make_header(clen, padlen) [version(), @type, @request_id, clen, padlen, 0].pack(HEADER_FORMAT) end