> --- a/ext/http11/http11.c
> +++ b/ext/http11/http11.c
> @@ -182,6 +182,7 @@ void http_field(void *data, const char *field, size_t
> flen, const char *value, s
> VALUE req = (VALUE)data;
> VALUE v = Qnil;
> VALUE f = Qnil;
> + VALUE e = Qnil;
>
> VALIDATE_MAX_LENGTH(flen, FIELD_NAME);
> VALIDATE_MAX_LENGTH(vlen, FIELD_VALUE);
On second thought, we're doing the concatenation _after_ the length
validation. I don't think this affects things much in practice since we
already have an overall header size limit and anything capable of
running Ruby/Mongrel shouldn't have to worry given about a few tens of
kilobytes...
> @@ -208,7 +209,13 @@ void http_field(void *data, const char *field, size_t
> flen, const char *value, s
> /* fprintf(stderr, "UNKNOWN HEADER <%s>\n", RSTRING_PTR(f)); */
> }
>
> - rb_hash_aset(req, f, v);
> + e = rb_hash_aref(req, f);
> + if (e == Qnil) {
> + rb_hash_aset(req, f, v);
> + } else {
> + rb_str_buf_cat(e, ",", 1);
> + rb_str_buf_append(e, v);
> + }
> }
_______________________________________________
Mongrel-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/mongrel-development