Sha256: 365a10dd505e097df2728b19cfa9e4261d801c0d365064f88e86bd6215e94d58

Contents?: true

Size: 912 Bytes

Versions: 2

Compression:

Stored size: 912 Bytes

Contents

require 'ffi'

module FFI
  module HTTP
    module Parser
      extend FFI::Library

      # Maximum header size
      HTTP_MAX_HEADER_SIZE = (80 * 1024)

      callback :http_data_cb, [:pointer, :pointer, :size_t], :int
      callback :http_cb, [:pointer], :int

      # HTTP Methods
      METHODS = enum :http_method, [
        :DELETE,
        :GET,
        :HEAD,
        :POST,
        :PUT,
        # pathological
        :CONNECT,
        :OPTIONS,
        :TRACE,
        # webdav
        :COPY,
        :LOCK,
        :MKCOL,
        :MOVE,
        :PROPFIND,
        :PROPPATCH,
        :UNLOCK,
        # subversion
        :REPORT,
        :MKACTIVITY,
        :CHECKOUT,
        :MERGE,
        # upnp
        :MSEARCH,
        :NOTIFY,
        :SUBSCRIBE,
        :UNSUBSCRIBE
      ]

      # HTTP Parser types
      TYPES = enum :http_parser_type, [:request, :response, :both]

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ffi-http-parser-0.2.0 lib/ffi/http/parser/types.rb
ffi-http-parser-0.1.0 lib/ffi/http/parser/types.rb