~ubuntu-branches/ubuntu/saucy/curl/saucy-proposed

« back to all changes in this revision

Viewing changes to docs/examples/chkspeed.c

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini
  • Date: 2013-04-18 12:55:09 UTC
  • mfrom: (1.3.2)
  • mto: (70.1.1 curl)
  • mto: This revision was merged to the branch mainline in revision 69.
  • Revision ID: package-import@ubuntu.com-20130418125509-qcx8ilk3om2p51ij
Tags: 7.30.0-1
* New upstream release
* Update upstream copyright years
* Drop patches merged upstream:
  - 08_NULL-pointer-dereference-on-close.patch
  - 09_CVE-213-1944.patch
  - 10_test1218-another-cookie-tailmatch-test.patch
* Update patches:
  - 03_keep_symbols_compat.patch
  - 90_gnutls.patch
  - 99_nss.patch
* Add libcurl4-doc package:
  - Move *.pdf and *.html files to the libcurl4-doc package
  - Add Suggests for -doc package to -dev packages
  - Move examples to the -doc package
* Add Build-Depends on python which is used by some tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
{
61
61
  CURL *curl_handle;
62
62
  CURLcode res;
63
 
  int prtsep = 0, prttime = 0;
 
63
  int prtall = 0, prtsep = 0, prttime = 0;
64
64
  const char *url = URL_1M;
65
65
  char *appname = argv[0];
66
66
 
77
77
          fprintf(stderr, "\r%s %s - %s\n",
78
78
                  appname, CHKSPEED_VERSION, curl_version());
79
79
          exit(1);
 
80
        } else if (strncasecmp(*argv, "-A", 2) == 0) {
 
81
          prtall = 1;
80
82
        } else if (strncasecmp(*argv, "-X", 2) == 0) {
81
83
          prtsep = 1;
82
84
        } else if (strncasecmp(*argv, "-T", 2) == 0) {
161
163
    if((CURLE_OK == res) && (val>0))
162
164
      printf("Average download speed: %0.3f kbyte/sec.\n", val / 1024);
163
165
 
 
166
    if (prtall) {
 
167
      /* check for name resolution time */
 
168
      res = curl_easy_getinfo(curl_handle, CURLINFO_NAMELOOKUP_TIME, &val);
 
169
      if((CURLE_OK == res) && (val>0))
 
170
        printf("Name lookup time: %0.3f sec.\n", val);
 
171
 
 
172
      /* check for connect time */
 
173
      res = curl_easy_getinfo(curl_handle, CURLINFO_CONNECT_TIME, &val);
 
174
      if((CURLE_OK == res) && (val>0))
 
175
        printf("Connect time: %0.3f sec.\n", val);
 
176
    }
 
177
 
164
178
  } else {
165
179
    fprintf(stderr, "Error while fetching '%s' : %s\n",
166
180
            url, curl_easy_strerror(res));