On Mon, 10 Sep 2001, Philippe M . Chiasson wrote:
> Here is an attempt at a simple implementation of $r->print(), copied mostly
> from mpxs_ap_rvputs().
great, a few comments..
> A few things worth noting:
>
> 1. It does support $|
> 2. It doesn't have timeouts like 1.3 used to have (is it needed anymore?)
not needed.
> 3. Should most the tests use $r->print() in the future ? (perl -pi ...)
no need to change current tests, most are using print (tied STDOUT), just
need to remove the alias in Apache::compat and change the PRINT alias in
Apache__RequestIO.h
> 4. While looking for sent_headers, discovered it's done and works already ;-)
yeah, print() doesn't need to check for that.
> 5. Somehow, I had to copy and paste bits of rvputs. Maybe a simple refactoring
> would make one call the other instaed (or yet one more macro, if speed is an
>issue)
we don't need the MP_USE_AP_RWRITE stuff, that was an old experiment that
will go away. number of macros won't effect speed, the are expanded
(inlined) by cpp at compile time.
> + /* XXX: should check if http headers were sent already, and send if not. */
don't need to.
> + mpxs_write_loop(modperl_wbucket_write, &rcfg->wbucket);
only need this, no need for #ifdef MP_USE_AP_RWRITE stuff.
> +
> + /* if ($|) */
> + if( IoFLAGS(GvIOp(PL_defoutgv)) & IOf_FLUSH ){
> + ap_rflush(r);
> + }
ap_rflush is not enough, you need for first call modperl_wbucket_flush.
also, there is an IoFLUSH macro defined in modperl_io.h so you can just
say:
if (IoFLUSH(PL_defoutgv)) {
(and your indenting/spacing is a bit off there :)
> + $r->print("Status: 200 Bottles of beer on the wall\n");
don't need to change print to $r->print in these tests.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]