Thanks, Mark!
I applied your patches and have uploaded a new dist up to CPAN:
The uploaded file
CGI-Application-Plugin-Stream-2.01.tar.gz
has entered CPAN as
file: $CPAN/authors/id/P/PU/PURDY/CGI-Application-Plugin-Stream-2.01.tar.gz
size: 5216 bytes
md5: 9c59699e8e953b2233d95a9cb2fb3f4d
I forgot to update the Changes file, so the changes header looks a little off. Devil's in the details... ;(
- Jason
Mark Stosberg wrote:
On 2005-03-30, Mark Stosberg <[EMAIL PROTECTED]> wrote:
On 2005-03-30, Mark Stosberg <[EMAIL PROTECTED]> wrote:
With the right URL on the command line, I was able to download the file and run a diff. Here it is:
$ diff -a old.pdf new.pdf 1c1 < %PDF-1.3 ---
1.3
1182a1183
1
\ No newline at end of file
I'll investigate these differences more.
The only thing I could find that seemed slightly odd in "::Stream" was the printing of a null character at end of the file:
print ''; # print a null string at the end
I couldn't determine conclusively that part of my issue. It certainly doesn't explain
why '%PDF-' is missing.
Here an angle that someone else may want work on: I checked to see if ::Stream
has any tests that confirm that the file that's transmitted is the exactly the same after the transmission.
It doesn't have a test like that. However, I stumbled immmediately when trying to create one.
The tests tie STDOUT, and printing the current contents of STDOUT (via
$content_sent) doesn't contain the contents of the file.
I've resolved this now, with help from Jason Purdy.
First, I think I think I found a definite bug in ::Stream. It sets a
'Size' header, which I don't think is correct. Setting 'Content-Length'
instead is correct.
The documentation also says to use 'size', and I think it should probably be updated to say 'Content_Length' instead. Perhaps 'size' could still be supported as a synonym.
Next, regarding the wrong file ending, it seems to be an issue that I wasn't following the documentation. :) I had this:
$self->stream_file(...);
When the docs recommended:
if ($self->stream_file(...) { return; }
FINALLY, I tracked down the bug which caused '%PDF-' to disappear.
After File::MMagic read from the file handle, it didn't return the
position back to the beginning.
I have a patch for much of this here:
http://mark.stosberg.com/Tech/perl/stream.patch
It could use some tests, especially for the 'seek' bug.
I've also filed a bug report with File::MMagic for it to put things back how it found them. :)
Mark
--------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/cgiapp@lists.erlbaum.net/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/cgiapp@lists.erlbaum.net/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]