Permalink
Browse files

croak if offset was given

  • Loading branch information...
spiritloose committed Oct 17, 2009
1 parent 32a1013 commit 3b98db774030a991284b5603d03507df72462ce4
Showing with 4 additions and 1 deletion.
  1. +4 −1 mod_psgi.c
View
@@ -105,14 +105,17 @@ XS(ModPSGI_Input_read)
SV *buf = ST(1);
request_rec *r = (request_rec *) mg_find(SvRV(self), PERL_MAGIC_ext)->mg_obj;
apr_size_t len = SvIV(ST(2));
- apr_size_t offset = items >= 4 ? SvIV(ST(3)) : 0;
apr_status_t rv;
apr_bucket_brigade *bb;
apr_bucket *bucket;
int eos = 0;
SV *ret;
dXSTARG;
+ if (items >= 4) {
+ croak("$env->{'psgi.input'}->read: mod_psgi can't handle offset");
+ }
+
ret = newSVpv("", 0);
bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
rv = ap_get_brigade(r->input_filters, bb, AP_MODE_READBYTES, APR_BLOCK_READ, len);

0 comments on commit 3b98db7

Please sign in to comment.