Skip to content

Commit

Permalink
remove parser.reset
Browse files Browse the repository at this point in the history
  • Loading branch information
copiousfreetime committed Jul 13, 2009
1 parent 827990a commit b14dbcb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
24 changes: 0 additions & 24 deletions ext/http-parser/http-parser_ext.c
Expand Up @@ -345,29 +345,6 @@ VALUE hpe_parser_content_length( VALUE self )
}


/*
* call-seq:
* parser.reset -> nil
*
* Reset the state of the parser to what it was upon initial
* instantiation. This resets the internal state machine and allows it
* to be used again.
*
* Also be aware, that immediately following the +on_message_complete+
* callback the Parser is also implicitly reset. Callbacks ARE NOT
* unregistered after a reset.
*
*/
VALUE hpe_parser_reset( VALUE self )
{
http_parser *parser;
VALUE rc;

Data_Get_Struct( self, http_parser, parser );
RESET_PARSER( parser );
return Qnil;
}

/*
* call-seq:
* parser.parse_chunk( String ) -> nil
Expand Down Expand Up @@ -499,7 +476,6 @@ void Init_http_parser_ext()
rb_define_method( cHttpParser, "version" ,hpe_parser_version , 0 );
rb_define_method( cHttpParser, "keep_alive?" ,hpe_parser_keep_alive , 0 );
rb_define_method( cHttpParser, "content_length" ,hpe_parser_content_length , 0 );
rb_define_method( cHttpParser, "reset" ,hpe_parser_reset , 0 );
rb_define_method( cHttpParser, "parse_chunk" ,hpe_parser_parse_chunk , 1 );

/* the common callbacks */
Expand Down
3 changes: 1 addition & 2 deletions lib/http/parser_callbacks.rb
Expand Up @@ -147,8 +147,7 @@ def on_message_complete( &block ) self.on_message_complete = block ; end
# an exception that happened inside a callback.
#
# After recieving an on_error callback, the parser is no longer useful in
# its current state. It should either be disposed of, or call
# +parser.reset+ to reset it to its initial state.
# its current state. It should be disposed of.
#
def on_error=(callable)
@on_error_callback = callable
Expand Down

0 comments on commit b14dbcb

Please sign in to comment.