[libapreq2] Should there be two temp (spool) files? - modperl

This is a discussion on [libapreq2] Should there be two temp (spool) files? - modperl ; When I post a multipart-form request I see two files being written in my temp directory: -rw------- 1 ryan users 8318656 2008-09-24 10:51 apreqK5Oiyc -rw------- 1 ryan users 8318484 2008-09-24 10:51 apreqQ1qs6C And: Apache2::Request->new($r)->upload('file')->tempname() indicates the spool file is "apreqQ1qs6C". ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: [libapreq2] Should there be two temp (spool) files?

  1. [libapreq2] Should there be two temp (spool) files?

    When I post a multipart-form request I see two files being written
    in my temp directory:

    -rw------- 1 ryan users 8318656 2008-09-24 10:51 apreqK5Oiyc
    -rw------- 1 ryan users 8318484 2008-09-24 10:51 apreqQ1qs6C

    And:

    Apache2::Request->new($r)->upload('file')->tempname()

    indicates the spool file is "apreqQ1qs6C".

    So I wonder what the file "apreqK5Oiyc" is all about. I imagine it is
    used to verify the bytes written and is just standard operating
    procedure, but I want to ensure I have not created this situation.

    Thanks and Cheers,
    -Ryan


  2. Re: [libapreq2] Should there be two temp (spool) files?




    --- On Wed, 9/24/08, Ryan Gies wrote:

    > When I post a multipart-form request I see two files being
    > written
    > in my temp directory:
    >
    > -rw------- 1 ryan users 8318656 2008-09-24 10:51
    > apreqK5Oiyc
    > -rw------- 1 ryan users 8318484 2008-09-24 10:51
    > apreqQ1qs6C
    >
    > And:
    >
    >
    > Apache2::Request->new($r)->upload('file')->tempname()
    >
    > indicates the spool file is "apreqQ1qs6C".
    >
    > So I wonder what the file "apreqK5Oiyc" is all
    > about.


    It's spooling the contents of the raw (unparsed) body.
    You can tell apreq not to do this by calling $r->discard_request_body
    in your handler after invoking Apache2::Request::new.







  3. Re: [libapreq2] Should there be two temp (spool) files?

    On Wed, 24 Sep 2008 11:08:24 -0700 (PDT)
    Joe wrote:

    > It's spooling the contents of the raw (unparsed) body.
    > You can tell apreq not to do this by calling $r->discard_request_body
    > in your handler after invoking Apache2::Request::new.


    When discarding the request body, I receive the error:

    End of file found

    (which happens when APR_BUCKET_IS_EOS). I can see the spool file being
    written and *presume* the multi-part boundary is missing. In a
    PerlHeaderParserHandler I am executing:

    1) Apache2::Request->new()
    2) $r->add_input_filter()
    3) $r->discard_request_body()

    Swapping steps 2 & 3 will yield same error. If calling
    $r->discard_request_body() like this is not commonly known to work maybe
    I should follow-up with the libapreq2 development list? If this is
    known to work then obviously I need to isolate error.


  4. Re: [libapreq2] Should there be two temp (spool) files?

    --- On Wed, 9/24/08, Ryan Gies wrote:

    > When discarding the request body, I receive the error:
    >
    > End of file found
    >
    > (which happens when APR_BUCKET_IS_EOS). I can see the
    > spool file being
    > written and *presume* the multi-part boundary is missing.
    > In a
    > PerlHeaderParserHandler I am executing:
    >
    > 1) Apache2::Request->new()
    > 2) $r->add_input_filter()
    > 3) $r->discard_request_body()


    Why are you doing step 2? You shouldn't need to add an
    input filter for apreq to work.

    > Swapping steps 2 & 3 will yield same error.


    > If calling
    > $r->discard_request_body() like this is not commonly
    > known to work maybe
    > I should follow-up with the libapreq2 development list? If
    > this is
    > known to work then obviously I need to isolate error.


    It's known to work for a few people, but it's not the default
    behavior. If you can't decipher why it's not working for you
    then asking on apreq-dev@ makes sense.






  5. Re: [libapreq2] Should there be two temp (spool) files?

    On Wed, 24 Sep 2008 12:07:23 -0700 (PDT)
    Joe wrote:

    > > 1) Apache2::Request->new()
    > > 2) $r->add_input_filter()
    > > 3) $r->discard_request_body()

    >
    > Why are you doing step 2? You shouldn't need to add an
    > input filter for apreq to work.


    Step 2 is Apache2::UploadProgress::track_progress

    > It's known to work for a few people, but it's not the default
    > behavior. If you can't decipher why it's not working for you
    > then asking on apreq-dev@ makes sense.


    I will try to reproduce the issue with a simple test case and follow up
    there if necessary. Thank you.


+ Reply to Thread