cURL / Mailing Lists / curl-users / Single Mail

curl-users

[ curl-Bugs-761260 ] no buffering (-N) does not work on stdout

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 26 Jun 2003 08:55:35 -0700

Bugs item #761260, was opened at 2003-06-26 10:55
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=761260&group_id=976

Category: client module
Group: wrong behaviour
Status: Open
Resolution: None
Priority: 5
Submitted By: Rick Richardson (rickrich)
Assigned to: Daniel Stenberg (bagder)
Summary: no buffering (-N) does not work on stdout

Initial Comment:
I believe this is a problem with all versions of curl
to date.

If you use the -N (no buffering) option to curl and the
output is stdout, then curl will fail to turn on no
buffering mode in my_fwrite() because the file is
already open.

I suggest getting rid of the setvbuf() stuff
altoghether. Use this
code instead at the bottom of my_fwrite()...

  rc = fwrite(buffer, size, nmemb, out->stream);
  if(config->nobuffer)
    fflush(out->stream);
  return rc;

setvbuf() is a known portability problem (SCO Xenix,
for example), so this change fixes the buffering
problem as well as removing a configure system
dependency. I don't know any systems where fflush() is
broken.

-Rick

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=761260&group_id=976

-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
Received on 2003-06-26