Created
March 4, 2012 08:18
Revisions
-
jordansissel created this gist
Mar 4, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ diff --git a/ext/ruby_http_parser/ruby_http_parser.c b/ext/ruby_http_parser/ruby_http_parser.c index 119d7e1..c2dd6ee 100644 --- a/ext/ruby_http_parser/ruby_http_parser.c +++ b/ext/ruby_http_parser/ruby_http_parser.c @@ -319,10 +319,11 @@ VALUE Parser_execute(VALUE self, VALUE data) { wrapper->stopped = Qfalse; size_t nparsed = ryah_http_parser_execute(&wrapper->parser, &settings, ptr, len); - if (wrapper->parser.upgrade) { - rb_str_cat(wrapper->upgrade_data, ptr + nparsed, len - nparsed); + //if (wrapper->parser.upgrade) { + //rb_str_cat(wrapper->upgrade_data, ptr + nparsed, len - nparsed); - } else if (nparsed != (size_t)len) { + //} else + if (nparsed != (size_t)len) { if (!RTEST(wrapper->stopped) && !RTEST(wrapper->completed)) rb_raise(eParserError, "Could not parse data entirely (%zu != %zu)", nparsed, len); else