Sha256: 73c83465521da6032b3a38dcbb60cd867ef679e9cba2e09f556ae64b3a1fe3da

Contents?: true

Size: 1.37 KB

Versions: 77

Compression:

Stored size: 1.37 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 "ruby.h"

#include <sys/types.h>

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

#define BUFFER_LEN 1024

struct http_parser;

typedef void (*element_cb)(struct http_parser* hp,
                           const char *at, size_t length);

typedef void (*field_cb)(struct http_parser* hp,
                         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;

  VALUE request;
  VALUE body;

  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;

  char buf[BUFFER_LEN];
  
} 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

77 entries across 77 versions & 2 rubygems

Version Path
puma-2.3.2-java ext/puma_http11/http11_parser.h
puma-2.3.2 ext/puma_http11/http11_parser.h
puma-2.3.1-java ext/puma_http11/http11_parser.h
puma-2.3.1 ext/puma_http11/http11_parser.h
puma-2.3.0-java ext/puma_http11/http11_parser.h
puma-2.3.0 ext/puma_http11/http11_parser.h
puma-2.2.2-java ext/puma_http11/http11_parser.h
puma-2.2.2 ext/puma_http11/http11_parser.h
puma-2.2.1-java ext/puma_http11/http11_parser.h
puma-2.2.1 ext/puma_http11/http11_parser.h
puma-2.2.0-java ext/puma_http11/http11_parser.h
puma-2.2.0 ext/puma_http11/http11_parser.h
puma-2.1.1-java ext/puma_http11/http11_parser.h
puma-2.1.1 ext/puma_http11/http11_parser.h
puma-2.1.0-java ext/puma_http11/http11_parser.h
puma-2.1.0 ext/puma_http11/http11_parser.h
puma-2.0.1-java ext/puma_http11/http11_parser.h
puma-2.0.1 ext/puma_http11/http11_parser.h
puma-2.0.0-java ext/puma_http11/http11_parser.h
puma-2.0.0 ext/puma_http11/http11_parser.h