Project

General

Profile

Bug #7957 » unicorn_http.patch

proposed patch to unicorn - normalperson (Eric Wong), 02/25/2013 09:54 PM

View differences:

ext/unicorn_http/unicorn_http.rl
assert(hp->s.dest_offset <= hp->offset &&
"destination buffer overflow");
advance_str(src, hp->offset);
rb_str_set_len(dst, hp->s.dest_offset);
if (0) {
/*
* the following should work, but raises:
* can't set length of shared string (RuntimeError)
*/
rb_str_modify(dst);
rb_str_set_len(dst, hp->s.dest_offset);
} else {
/* this does not raise */
rb_str_resize(dst, hp->s.dest_offset);
}
if (RSTRING_LEN(dst) == 0 && chunked_eof(hp)) {
assert(hp->len.chunk == 0 && "chunk at EOF but more to parse");
(2-2/2)