cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: runtests.pl change

From: Roth, Kevin P. <KPRoth_at_MarathonOil.com>
Date: Thu, 24 Jan 2002 12:12:20 -0500

That is indeed common - the error number is always 52.

I dug into this a bit more. Here's what I've observed so far.
Look towards the bottom for my new fix.

1.

I've used a line like this for all tests (to repeat a single test):
  $ ./runtests.pl -k -v 1 1 1 1 1 1 1 1 1 1 1 1

2.

Any time this error happens, if I look in the file
log/curl$testnum.out, I see exactly one line:
  "HTTP/1.1 200 OK"
No other headers or data are in there. But if it succeeds,
all data returned by httpserver.pl shows up in there.

3.

I noticed that if I enabled "protocol debugging" (runtests.pl -d...),
I never see any error.

4.

I tried adding some extra STDERR tracing in httpserver.pl (the ++ line):

    # send a custom reply to the client
    my @data = getpart("reply", "data$part");
    for(@data) {
 ++ print STDERR "[Kevin] OUT: $_";
        print $_;
        if($verbose) {
            print STDERR "OUT: $_";
        }
    }

With this change, I no longer get error 52's. Instead, I get error 18's
(incomplete transfer). And I see the following line in stderr$testnum:

  curl: (18) transfer closed with 6 bytes remaining to read

Unknown whether the number of bytes is always 6.

5.

OK, so it seems that adding `print STDERR ...` commands before
the `print $_` (in httpserver.pl's #send-a-custom-reply section)
causes error 18. And enabling the $verbose output via -d (which
prints to STDERR *after* stdout) fixes the problem entirely.

I don't understand perl well enough to even venture a guess,
however, the following change seems to clear up the problem
completely on my machine:

    # flush data:
 -- $| = 1;
 ++ #$| = 1;

    # send a custom reply to the client
    my @data = getpart("reply", "data$part");

Hopefully, this info will help one of you all find the real problem.

Thanks,
--Kevin

-----Original Message-----
From: Daniel Stenberg [mailto:daniel_at_haxx.se]
Sent: Thursday, January 24, 2002 4:09 AM

What kind of errors do you typically get? What output does the script
report?
Do you usually get the same kind of errors?

Your example snippet returned 52 (no output from HTTP server) instead of
0.
Is that common?

The HTTP server is my (poor) attempt at writing a perl server. I know it
doesn't run properly everywhere, and this is likely because of my perl
code.

While I appreciate your efforts and your patch, I really don't think
that is
any good path to take, I think we should instead focus on getting a perl
http
server that *works*. On pretty much all platforms.
Received on 2002-01-24