cURL / Mailing Lists / curl-users / Single Mail

curl-users

FTP server issue in 7.10.4

From: Roth, Kevin P. <KPRoth_at_MAPLLC.com>
Date: Wed, 2 Apr 2003 12:42:36 -0500

I was looking forward to building up this new version, but ran into a long list of tests that failed:

 102 103 106 120 121 124 126 127 136 137

They were getting "curl returned status 18, when 0 was expected". And the stderr files told more - they said something like "51 bytes expected, but received 57".

After some digging, the problem appears to be related to line-endings again. I made the following patch to tests/ftpserver.pl, and they seemed to be fine after that:

---------------------------
@@ -192,6 +192,7 @@
         $size=0;
         @data = getpart("reply", "data");
         for(@data) {
+ s/\n/\r\n/; #must change \n's to \r\n's
             $size += length($_);
         }
         if($size) {
---------------------------

Apparently, the data being read in from the test102 file had unix line-endings (\n), but when printing the data back out to the SOCK in ftpserver.pl, those were getting changed to \r\n's (internet standard...). Changing the size calculation to be aware of this switch fixes the issue.

I don't know whether this affects just windows machines, or all of them...

I also had to adjust test #110. It had a hard-coded size of 85, and after changing it to 87 it worked OK.

There may be a more elegant solution; I'll leave it up to Daniel to choose how best to fix this.

Note - it doesn't affect the curl code, just the test code, so I don't see any reason to re-release version 7.10.4...

Thanks,
- Kevin

p.s. Tests 500 and 503 are still not working, if run after a previous one (such as 138). They work fine individually though. Daniel - I think you said you grabbed a copy of Cygwin and fixed this problem; did the fix make it into this codebase?

-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth!
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
Received on 2003-04-02