Skip to content

Instantly share code, notes, and snippets.

@jordansissel
Created March 4, 2012 08:18
Show Gist options
  • Save jordansissel/1971244 to your computer and use it in GitHub Desktop.
Save jordansissel/1971244 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment