Sha256: 26308c2d025c062e7843fa443c5d77bb15d294f2c54b0a606c9352a2c5e73a72

Contents?: true

Size: 1.14 KB

Versions: 159

Compression:

Stored size: 1.14 KB

Contents

/**
 * Copyright (c) 2005 Zed A. Shaw
 * You can redistribute it and/or modify it under the same terms as Ruby.
 */

#ifndef http11_parser_h
#define http11_parser_h

#include <sys/types.h>

#if defined(_WIN32)
#include <stddef.h>
#endif

typedef void (*element_cb)(void *data, const char *at, size_t length);
typedef void (*field_cb)(void *data, const char *field, size_t flen, const char *value, size_t vlen);

typedef struct http_parser { 
  int cs;
  size_t body_start;
  int content_len;
  size_t nread;
  size_t mark;
  size_t field_start;
  size_t field_len;
  size_t query_start;

  void *data;

  field_cb http_field;
  element_cb request_method;
  element_cb request_uri;
  element_cb fragment;
  element_cb request_path;
  element_cb query_string;
  element_cb http_version;
  element_cb header_done;
  
} http_parser;

int http_parser_init(http_parser *parser);
int http_parser_finish(http_parser *parser);
size_t http_parser_execute(http_parser *parser, const char *data, size_t len, size_t off);
int http_parser_has_error(http_parser *parser);
int http_parser_is_finished(http_parser *parser);

#define http_parser_nread(parser) (parser)->nread 

#endif

Version data entries

159 entries across 159 versions & 21 rubygems

Version Path
IOWA-1.0.3 ext/http11/http11_parser.h
IOWA-1.0.2 ext/http11/http11_parser.h
gross-1.7.2 ext/thin_parser/parser.h
thin-1.7.2 ext/thin_parser/parser.h
thin-1.7.1 ext/thin_parser/parser.h
IOWA-1.0.0 ext/http11/http11_parser.h
arcabouco-0.2.13 vendor/bundle/gems/thin-1.7.0/ext/thin_parser/parser.h
thin-1.7.0 ext/thin_parser/parser.h
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/thin-1.6.4/ext/thin_parser/parser.h
classiccms-0.7.5 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/parser.h
classiccms-0.7.4 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/parser.h
classiccms-0.7.3 vendor/bundle/gems/thin-1.3.1/ext/thin_parser/parser.h
thin-1.6.4 ext/thin_parser/parser.h
thin-1.6.3 ext/thin_parser/parser.h
engineyard-mongrel-1.1.4 ext/http11/http11_parser.h
freels-mongrel-1.1.2 ext/http11/http11_parser.h
grockit-thin-0.8.2 ext/thin_parser/parser.h
headius-mongrel-1.1.6.1 ext/http11/http11_parser.h
macournoyer-thin-1.0.1 ext/thin_parser/parser.h
macournoyer-thin-1.1.0 ext/thin_parser/parser.h