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

request_id[R]
type[R]

Public Class Methods

class_for(type) click to toggle source
# File lib/fcgi.rb, line 313
def self::class_for(type)
  RECORD_CLASS[type]
end
new(type, reqid) click to toggle source
# File lib/fcgi.rb, line 317
def initialize(type, reqid)
  @type = type
  @request_id = reqid
end
parse_header(buf) click to toggle source
# File lib/fcgi.rb, line 309
def self::parse_header(buf)
  return *buf.unpack(HEADER_FORMAT)
end

Public Instance Methods

management_record?() click to toggle source
# File lib/fcgi.rb, line 329
def management_record?
  @request_id == FCGI_NULL_REQUEST_ID
end
serialize() click to toggle source
# File lib/fcgi.rb, line 333
def serialize
  body = make_body()
  padlen = body.length % 8
  header = make_header(body.length, padlen)
  header + body + "\000" * padlen
end
version() click to toggle source
# File lib/fcgi.rb, line 322
def version
  ::FCGI::ProtocolVersion
end