Sha256: d8eafe69638278204b497fd2abcaa89ce9245d3d904015d6546caa427ce35cd4

Contents?: true

Size: 1.17 KB

Versions: 68

Compression:

Stored size: 1.17 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 httpclient_parser { 
  int cs;
  size_t body_start;
  int content_len;
  size_t nread;
  size_t mark;
  size_t field_start;
  size_t field_len;

  void *data;

  field_cb http_field;
  element_cb reason_phrase;
  element_cb status_code;
  element_cb chunk_size;
  element_cb http_version;
  element_cb header_done;
  element_cb last_chunk;
  
  
} httpclient_parser;

int httpclient_parser_init(httpclient_parser *parser);
int httpclient_parser_finish(httpclient_parser *parser);
size_t httpclient_parser_execute(httpclient_parser *parser, const char *data, size_t len, size_t off);
int httpclient_parser_has_error(httpclient_parser *parser);
int httpclient_parser_is_finished(httpclient_parser *parser);

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

#endif

Version data entries

68 entries across 68 versions & 12 rubygems

Version Path
arunthampi-evented_net-0.1.1 ext/http11_client/http11_parser.h
arunthampi-evented_net-0.1.2 ext/http11_client/http11_parser.h
astro-em-http-request-0.1.3.20090419 ext/http11_client/http11_parser.h
astro-em-http-request-0.1.5 ext/http11_client/http11_parser.h
astro-em-http-request-0.1.6 ext/http11_client/http11_parser.h
camerontaylor-em-http-request-0.1.7 ext/http11_client/http11_parser.h
dwaite-em-http-request-0.1.10 ext/http11_client/http11_parser.h
dwaite-em-http-request-0.1.9 ext/http11_client/http11_parser.h
igrigorik-em-http-request-0.1.1 ext/http11_client/http11_parser.h
igrigorik-em-http-request-0.1.3 ext/http11_client/http11_parser.h
igrigorik-em-http-request-0.1.5 ext/http11_client/http11_parser.h
igrigorik-em-http-request-0.1.6 ext/http11_client/http11_parser.h
igrigorik-em-http-request-0.1.7 ext/http11_client/http11_parser.h
julien51-em-http-request-0.1.10 ext/http11_client/http11_parser.h
julien51-em-http-request-0.1.11 ext/http11_client/http11_parser.h
julien51-em-http-request-0.1.9 ext/http11_client/http11_parser.h
tmm1-em-http-request-0.1.0 ext/http11_client/http11_parser.h
tmm1-em-http-request-0.1.1 ext/http11_client/http11_parser.h
cool.io-1.2.4 ext/http11_client/http11_parser.h
cool.io-1.2.3-x86-mingw32 ext/http11_client/http11_parser.h