Bug #7957 » unicorn_http.patch
| 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");
|
||
- « Previous
- 1
- 2
- Next »