Re: Sending large file as attachment to clients

2008-03-25 Thread Joe Lewis

Subra A Narayanan wrote:

Thanks for the replies guys. I will try ur suggestions once I get to work
today. Just a few more questions:

  

Check out the various filter/bucket brigade examples. This may do just
what you want. I've used it to 'gate' the final sending for things ike
throttling and keeping buggy telco bearer boxes happy.




Dirk: Do you remember any filter/bucket off the top of ur head that I can
look at?
  


I would suggest perusing the source code for Nick Kew's mod_csv - a 
module that takes the contents of a .csv file and generates an HTML 
table.  It utilizes bucket brigade creation.


http://apache.webthing.com/mod_csv/

You should find a lot of useful bits of code in there.  I'd still 
suggest the simple loop to see if that works better.





  

Samuel was aiming the right direction.  If you can read in pieces of the
data to send, you should be able to loop over that reading a chunk of
data, then sending it, then reading a chunk the same size (same block,
for example), and continuing until the data has been sent.  Try that to
see if you obtain a different result.




Joe: Do you mean this:

while(!EOF)
{
   Read chunk of data;
   ap_rwrite(objBuffer, bufferLen, request);
}

Can I use the ap_rwrite function for sending chunks of data too? Or should I
be using some other function in the API for this?

I will test out these suggestions and report my findings asap.

Thanks!

  
That is exactly what I meant.  The ap_rwrite is a function I recently 
had to use for a file synchronization plugin for Apache, and it worked 
quite well (just my opinion, though).  Test both to see which ways work 
faster, and which ways are just easier to understand.


Joe


Re: Sending large file as attachment to clients

2008-03-25 Thread Subra A Narayanan
Thanks for the replies guys. I will try ur suggestions once I get to work
today. Just a few more questions:

>
>
> Check out the various filter/bucket brigade examples. This may do just
> what you want. I've used it to 'gate' the final sending for things ike
> throttling and keeping buggy telco bearer boxes happy.


Dirk: Do you remember any filter/bucket off the top of ur head that I can
look at?


>
> Samuel was aiming the right direction.  If you can read in pieces of the
> data to send, you should be able to loop over that reading a chunk of
> data, then sending it, then reading a chunk the same size (same block,
> for example), and continuing until the data has been sent.  Try that to
> see if you obtain a different result.
>

Joe: Do you mean this:

while(!EOF)
{
   Read chunk of data;
   ap_rwrite(objBuffer, bufferLen, request);
}

Can I use the ap_rwrite function for sending chunks of data too? Or should I
be using some other function in the API for this?

I will test out these suggestions and report my findings asap.

Thanks!