Meaning of libcurl messages and execution process

29,991

Solution 1

cURL's Man Page specifies three types of "special" verbose output:

A line starting with '>' means "header data" sent by curl, '<' means "header data" received by curl that is hidden in normal cases, and a line starting with '*' means additional info provided by curl.

You can read about HTTP header fields in the HTTP official publication page. Any other output lines displayed by cURL belong to the HTTP body carried by the corresponding message.

So what is the actual meaning of these informationals starting with *, you ask? They inform you about the status of the transfer's TCP connection with the host. For instance:

  • "Connected to (nil) (182.72.67.14) port 65101 (#0)" means that a TCP connection is established with the server side (in your case: 182.72.67.14). The #0 is the TCP session number (which is used only by cURL). The nil indicates that the host name couldn't be resolved via DNS (had it been resolved, the it would've appeared instead of nil).

  • "Connection #0 to host (nil) left intact" means that although the transfer is over, the TCP session itself is still open (i.e no FIN/ACK exchanges have been made), allowing you to keep reusing the same TCP connection for multiple transfers (which could be useful if you don't want to sacrifice time on opening a new TCP connection).

    The message "Re-using existing connection! (#0) with host (nil)" supports that, indicating that cURL does indeed that, riding an existing TCP connection (from a previous transfer).

Solution 2

Marked by < are HTTP headers.You can read in detail about http headers and their meaning here and marked by * are verbose information provided by curl which is displayed on stderr.

Share:
29,991

Related videos on Youtube

harshal bhavsar
Author by

harshal bhavsar

hi

Updated on July 05, 2022

Comments

  • harshal bhavsar
    harshal bhavsar almost 2 years

    I am using libcurl library to fetch abc-1.tar file from server. I want to know meaning of message which is display and process of execution of libcurl to display this messages.

    For Example: I provide some messages below out of that I know basic message meaning like Content-Length means length of file which are downloaded, etc.

    I want meaning of all messages, particularly messages which are start with * (e. g. Connection #0 to host (nil) left intact)

    * Re-using existing connection! (#0) with host (nil)
    * Connected to (nil) (182.72.67.14) port 65101 (#0)
    GET /...... HTTP/1.1
    Host: 182.72.67.14:65101
    Accept: */*
    Connection:keep-alive
    < HTTP/1.1 200 OK
    < Cache-Control: private
    < Content-Length: 186368
    < Content-Type: application/x-tar
    < Server: Microsoft-IIS/7.5
    < Content-Disposition: attachment; filename=abc-1.tar
    < X-AspNet-Version: 4.0.30319
    < X-Powered-By: ASP.NET
    < Date: Tue, 01 Oct 2013 06:29:00 GMT
    < 
    * Connection #0 to host (nil) left intact
    
  • harshal bhavsar
    harshal bhavsar over 10 years
    I want detail information of marked by '*'. Is there any path to know about this.
  • Ponni Radhakrishnan
    Ponni Radhakrishnan over 6 years
    does "Connection #0 to host (nil) left intact" suggest keep-alive, is being set by the server?
  • Eitan T
    Eitan T over 6 years
    @CharlesOkwuagwu I would assume so, yes.