Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Dec 17, 2012
  1. @tomika @bnoordhuis

    Add on_status_complete callback.

    tomika authored bnoordhuis committed
    Add a "status complete" callback to support Simple-Response handling with HTTP
    version <= 1.0.
    Patch by Tóth Tamás, tests by Corey Richardson.
Commits on Dec 5, 2012
  1. @cmr @bnoordhuis

    Fix unmatched quote in dump_url output.

    cmr authored bnoordhuis committed
  2. @cmr @bnoordhuis

    Fix IPv6 address parsing.

    cmr authored bnoordhuis committed
    Fixes #133.
Commits on Nov 29, 2012
  1. @bnoordhuis
  2. @bnoordhuis
Commits on Nov 10, 2012
  1. @bnoordhuis

    Remove HTTP_PARSER_DEBUG macro.

    bnoordhuis authored
    Remove the HTTP_PARSER_DEBUG macro for two reasons:
    * It changes the size of struct http_parser, resulting in spurious memory
      corruption bugs if part of your application is built with HTTP_PARSER_DEBUG=1
      and other parts with HTTP_PARSER_DEBUG=0.
    * It's a debugging tool for maintainers. It should never have been exposed in
      the API in the first place.
Commits on Sep 1, 2012
  1. @bog-dan-ro @bnoordhuis

    Add "int http_body_is_final(const http_parser *parser)" method.

    bog-dan-ro authored bnoordhuis committed
    It's useful to check if the current chunk is the last one.
Commits on Aug 29, 2012
  1. @bnoordhuis
Commits on Jul 24, 2012
Commits on Jul 17, 2012
  1. Use new state instead of pointer

    Bertrand Paquet authored
  2. Coding style improvment

    Bertrand Paquet authored
Commits on Jul 8, 2012
  1. Add tests

    Bertrand Paquet authored
  2. Small refactoring, add edge cases

    Bertrand Paquet authored
  3. Add tests on user info

    Bertrand Paquet authored
  4. User info implementation

    Bertrand Paquet authored
Commits on Jul 7, 2012
  1. Check host on url with hostname:port

    Bertrand Paquet authored
Commits on Jun 9, 2012
  1. @martell @bnoordhuis

    test: %zu to %lu for msvcrt fixes for Mingw64

    martell authored bnoordhuis committed
Commits on Apr 23, 2012
  1. @bnoordhuis

    Don't assert() on whitespace in URL.

    bnoordhuis authored
    Be lenient about tabs and form feeds in non-strict mode.
Commits on Mar 12, 2012
  1. @TooTallNate @bnoordhuis

    add support for "SEARCH" request methods

    TooTallNate authored bnoordhuis committed
  2. @TooTallNate @bnoordhuis

    test.c: fix off-by-one on the requests test cases

    TooTallNate authored bnoordhuis committed
Commits on Feb 27, 2012
  1. @bnoordhuis

    test: abort(), don't exit()

    bnoordhuis authored
    Makes it easier to debug failing test cases: abort() dumps core and asserts
    in a debugger.
Commits on Feb 20, 2012
  1. @bnoordhuis
Commits on Feb 18, 2012
  1. @dgwynne @bnoordhuis

    fix non-CONNECT tests missing port/hostname bits

    dgwynne authored bnoordhuis committed
    set is_connect properly
  2. @dgwynne @bnoordhuis

    allow extra ? at the beginning of a query_string.

    dgwynne authored bnoordhuis committed
    fixes joyent/http-parser issue #25
  3. @dgwynne @bnoordhuis

    implement parsing of v6 addresses and rejection of 0-length host and …

    dgwynne authored bnoordhuis committed
    the v6 parsing works by adding extra states for working with the
    [] notation for v6 addresses. hosts and ports cannot be 0-length
    because we url parsing from ending when we expect those fields to
    http_parser_parse_url gets a free check for the correctness of
    CONNECT urls (they can only be host:port).
    this addresses the following issues:
    i was bored and had my head in this space.
Commits on Feb 9, 2012
  1. @dgwynne @bnoordhuis

    Fix http_parser_parse_url for urls like "http://host/path".

    dgwynne authored bnoordhuis committed
    Before this change it would include the last slash in the separator between the
    schema and host as part of the host. we cant use the trick used for skipping the
    separator before ports, query strings, and fragments because if it was a CONNECT
    style url string (host:port) it would skip the first character of the hostname.
    Work around this by introducing a few more states to represent these separators
    in a url differently to what theyre separating. this in turn lets us simplify
    the url parsing so can simply skip what it considers delimiters rather than
    having to special case certain types of url parts and skip their prefixes.
    Add tests for the http_parser_parse_url().
    This compares the http_parser_url struct that http_parser_parse_url()
    produces against one that we expect from the test. If they differ
    then http_parser_parse_url() misbehaved.
  2. @bnoordhuis
Commits on Jan 27, 2012
  1. @bnoordhuis
  2. @ivosh @bnoordhuis

    http_parser_init does not clear status_code

    ivosh authored bnoordhuis committed
Commits on Jan 13, 2012
  1. @pgriess

    Merge pull request #73 from pgriess/http-10-message-length

    pgriess authored
    Get HTTP/1.1 message length logic working for HTTP/1.0
Commits on Jan 9, 2012
  1. @pgriess

    Implement http_parser_pause().

    pgriess authored
    - Add http_parser_pause() API. A callback may invoke this at any time.
      This will cause http_parser_parse() to return indicating that it
      parsed less than the number of requested bytes and set an error to
      HBE_PAUSED. A paused parser with fail with HBE_PAUSED until it is
      un-paused with http_parser_pause().
    - Stop using 'state', 'header_state', 'index', and 'nread' shadow
      variables and then updating their http_parser fields when we're done.
      Instead, update the live values as we go. This will make it possible
      to return from anywhere in the parser (say, due to EPAUSED) and have
      valid/expected state.
    - Update state before making callbacks so that if the want to pause,
      we'll know the correct state already.
    - Make sure that every callback has a state that uniquely identifies the
      next step so that we can resume in the right place if we were suppoed
      to be paused.
    - Clean and re-factor up CALLBACK() macros.
    - Use CALLBACK() macros for (almost) all callbacks; on_headers_complete
      is still a special case. This includes on_body which we used to invoke
      manually with a long run of bytes. We now use a 'body' mark and hit
      its callback just like every other data callback.
    - Clean up (most) gotos and replace with real states.
    - Add some unit tests.
    Fixes #70
Commits on Jan 7, 2012
  1. @pgriess

    Don't wait for EOF on 0-length KA messages.

    pgriess authored
    - Break EOF handling out of http_should_keep_alive() into
      http_message_needs_eof(), which we now use when determining what to do
      with a message of unknown length. This prevents us from falling into
      the s_body_identity_eof state in the cases where we actually *do* know
      the length of the message (e.g. because the response status was 204).
  2. @pgriess

    Get HTTP/1.1 message length logic working for HTTP/1.0

    pgriess authored
    - Port message length logic from #72 to HTTP/1.0.
    - Add a bunch of unit tests for handling 0-length messages.
  3. @pgriess

    Add http_parser_parse_url().

    pgriess authored
    - Add an http_parser_parse_url() method to parse a URL into its
      constituent components. This uses the same underlying parser
      as http_parser_parse() and doesn't do any data copies.
    - Re-add the URL components in various test.c structures; validate
      them when parsing.
Commits on Jan 6, 2012
  1. @pgriess

    Remove some chars from tokens[] per RFC.

    pgriess authored
    - Treat ' ' specially, as apparently IIS6.0 can send this in headers.
      Allow this character through if we're not in strict mode.
    - Move some test code around so that test indices don't break when
      HTTP_PARSER_STRICT changes.
    Fixes #13.
Something went wrong with that request. Please try again.