-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POST request times out in Win32 when posting a file with CR,LF line terminator. #89
Comments
could you please show me a minimal script which can reproduce? |
Sure, this is basically the second |
Hello! Would like to add that I can take some of my time to help with this. Sorry for writing this within the issue thread, but I don't know if there are other means of communication (mailing list, irc, etc) for the project. Thanks! |
sorry about delay. I'm looking this just now. when using |
You need to set open my $req_content_fh, '<:raw', $ARGV[0] or die "oops"; # Any input file with CR,LF line terminators Because $req_content doesn't contains CR. |
Got it man, thanks! So if it's the user's responsibility to set the |
In Windows, when doing a POST request a file with
CR,LF
newlines, the request times out. I tried to trace down the problem and what I have found so far is that when theContent-Length
is calculated, the file size is calculated correctly. On the other hand, the number of bytes received by the server equals theContent-Length
minus the number of lines in the file, that's why the server times out waiting for the total of bytes to be transferred.I'm not expert in how the PerlIO layers work, but the documentation mentions that in
MS-DOS
like systems a translation fromCR,LF
into\n
is made, so that's seems to be the reason why the server is reading one byte short per each line of the file. If I change the file handle tobinmode
before my request, the problem is fixed.This is where the questions arise: Is it responsability of the user to set the file handle to
binmode
? Or should this be transparent to the user?I noticed the problem when the test
t\100_low\09_body.t
failed because the file was transformed to CRLF terminators when I cloned from github. If the file has the Unix terminator, the test is successful.Thanks
The text was updated successfully, but these errors were encountered: