You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dirk-Willem van Gulik <di...@covalent.net> on 2001/10/29 21:05:40 UTC
2.0 / POST read example
Anyone a good pointer as to where to snarf proper 'post' read code; i.e. I
need to get some post data processing done in a handler in a module - and
want to do it properly -i.e. through the filter chain etc.
Any place I can cut and paste this from :-)
Dw
Re: 2.0 / POST read example
Posted by Dirk-Willem van Gulik <di...@covalent.net>.
On Mon, 29 Oct 2001, Greg Stein wrote:
> You can also toss a layer out (and a copy!) if you're willing to deal with
> brigades, and use ap_get_brigade().
Thanks - trying...
Dw
Re: 2.0 / POST read example
Posted by Greg Stein <gs...@lyra.org>.
As Ryan points out: the old functions work quite fine.
You can also toss a layer out (and a copy!) if you're willing to deal with
brigades, and use ap_get_brigade().
Cheers,
-g
On Mon, Oct 29, 2001 at 12:14:54PM -0800, Ryan Bloom wrote:
>
> Use the same code that you would have used in 1.3, namely ap_setup_client_block,
> ap_get_client_block, etc. The filtering is all done under the covers.
>
> Ryan
>
> On Monday 29 October 2001 12:05 pm, Dirk-Willem van Gulik wrote:
> > Anyone a good pointer as to where to snarf proper 'post' read code; i.e. I
> > need to get some post data processing done in a handler in a module - and
> > want to do it properly -i.e. through the filter chain etc.
> >
> > Any place I can cut and paste this from :-)
> >
> > Dw
--
Greg Stein, http://www.lyra.org/
Re: 2.0 / POST read example
Posted by Ryan Bloom <rb...@covalent.net>.
On Monday 29 October 2001 01:02 pm, Dirk-Willem van Gulik wrote:
> On Mon, 29 Oct 2001, Ryan Bloom wrote:
> > On Monday 29 October 2001 12:24 pm, Dirk-Willem van Gulik wrote:
> >
> > Timeouts are all handled by the server now. If you want to set a
> > different timeout, you will have to call apr_set_socketopt on c->client.
>
> Very neat. Is there something similar if I want to timeout on aquicking a
> lock with apr_file_(un)lock ?
Nope.
Ryan
______________________________________________________________
Ryan Bloom rbb@apache.org
Covalent Technologies rbb@covalent.net
--------------------------------------------------------------
Re: 2.0 / POST read example
Posted by Dirk-Willem van Gulik <di...@covalent.net>.
On Mon, 29 Oct 2001, Ryan Bloom wrote:
> On Monday 29 October 2001 12:24 pm, Dirk-Willem van Gulik wrote:
>
> Timeouts are all handled by the server now. If you want to set a different
> timeout, you will have to call apr_set_socketopt on c->client.
Very neat. Is there something similar if I want to timeout on aquicking a
lock with apr_file_(un)lock ?
Dw
Re: 2.0 / POST read example
Posted by Ryan Bloom <rb...@covalent.net>.
On Monday 29 October 2001 12:24 pm, Dirk-Willem van Gulik wrote:
Timeouts are all handled by the server now. If you want to set a different
timeout, you will have to call apr_set_socketopt on c->client.
Ryan
> Any equivalency for the timeout's ?
>
> Dw.
>
> /* read post data and move to full separate buffer */
> data = apr_pcalloc(r->pool, length + 1); /* own error handling exit
>
> // ap_hard_timeout("specweb99_post_handler read", r);
>
> while ((len_read =
> ap_get_client_block(r, argsbuffer, sizeof(argsbuffer))) > 0) {
>
> // ap_reset_timeout(r);
>
> if ((rpos + len_read) > length) {
> rsize = length - rpos;
> }
> else {
> rsize = len_read;
> }
> memcpy((char *)data + rpos, argsbuffer, rsize);
> rpos += rsize;
> }
>
> // ap_kill_timeout(r);
>
> data[length] = '\0';
>
> On Mon, 29 Oct 2001, Ryan Bloom wrote:
> > On Monday 29 October 2001 12:05 pm, Dirk-Willem van Gulik wrote:
> >
> > Use the same code that you would have used in 1.3, namely
> > ap_setup_client_block, ap_get_client_block, etc. The filtering is all
> > done under the covers.
> >
> > Ryan
> >
> > > Anyone a good pointer as to where to snarf proper 'post' read code;
> > > i.e. I need to get some post data processing done in a handler in a
> > > module - and want to do it properly -i.e. through the filter chain etc.
> > >
> > > Any place I can cut and paste this from :-)
> > >
> > > Dw
--
______________________________________________________________
Ryan Bloom rbb@apache.org
Covalent Technologies rbb@covalent.net
--------------------------------------------------------------
Re: 2.0 / POST read example
Posted by Dirk-Willem van Gulik <di...@covalent.net>.
Any equivalency for the timeout's ?
Dw.
/* read post data and move to full separate buffer */
data = apr_pcalloc(r->pool, length + 1); /* own error handling exit
// ap_hard_timeout("specweb99_post_handler read", r);
while ((len_read =
ap_get_client_block(r, argsbuffer, sizeof(argsbuffer))) > 0) {
// ap_reset_timeout(r);
if ((rpos + len_read) > length) {
rsize = length - rpos;
}
else {
rsize = len_read;
}
memcpy((char *)data + rpos, argsbuffer, rsize);
rpos += rsize;
}
// ap_kill_timeout(r);
data[length] = '\0';
On Mon, 29 Oct 2001, Ryan Bloom wrote:
> On Monday 29 October 2001 12:05 pm, Dirk-Willem van Gulik wrote:
>
> Use the same code that you would have used in 1.3, namely ap_setup_client_block,
> ap_get_client_block, etc. The filtering is all done under the covers.
>
> Ryan
>
> > Anyone a good pointer as to where to snarf proper 'post' read code; i.e. I
> > need to get some post data processing done in a handler in a module - and
> > want to do it properly -i.e. through the filter chain etc.
> >
> > Any place I can cut and paste this from :-)
> >
> > Dw
>
>
Re: 2.0 / POST read example
Posted by Ryan Bloom <rb...@covalent.net>.
On Monday 29 October 2001 12:05 pm, Dirk-Willem van Gulik wrote:
Use the same code that you would have used in 1.3, namely ap_setup_client_block,
ap_get_client_block, etc. The filtering is all done under the covers.
Ryan
> Anyone a good pointer as to where to snarf proper 'post' read code; i.e. I
> need to get some post data processing done in a handler in a module - and
> want to do it properly -i.e. through the filter chain etc.
>
> Any place I can cut and paste this from :-)
>
> Dw
--
______________________________________________________________
Ryan Bloom rbb@apache.org
Covalent Technologies rbb@covalent.net
--------------------------------------------------------------