cURL / Mailing Lists / curl-users / Single Mail


RE: change

From: Roth, Kevin P. <>
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.


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


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 shows up in there.


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


I tried adding some extra STDERR tracing in (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.


OK, so it seems that adding `print STDERR ...` commands before
the `print $_` (in'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.


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

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

Your example snippet returned 52 (no output from HTTP server) instead of
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

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
server that *works*. On pretty much all platforms.
Received on 2002-01-24