~ubuntu-branches/ubuntu/dapper/curl/dapper

« back to all changes in this revision

Viewing changes to src/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Domenico Andreoli
  • Date: 2002-03-12 19:06:21 UTC
  • Revision ID: james.westby@ubuntu.com-20020312190621-iztop53k88qlo29k
Tags: 7.9.5-1
* New upstream version (Closes: #134608).
* Added autotools-dev to the build dependencies. config.{guess,sub}
  can now be updated automatically in the build process.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1733
1733
}
1734
1734
 
1735
1735
struct ProgressData {
1736
 
  size_t total;
1737
 
  size_t prev;
1738
 
  size_t point;
 
1736
  int calls;
 
1737
  double total;
 
1738
  double prev;
 
1739
  double point;
1739
1740
  int width;
1740
1741
  FILE *out; /* where to write everything to */
1741
1742
};
1742
1743
 
1743
1744
int myprogress (void *clientp,
1744
 
                size_t dltotal,
1745
 
                size_t dlnow,
1746
 
                size_t ultotal,
1747
 
                size_t ulnow)
 
1745
                double dltotal,
 
1746
                double dlnow,
 
1747
                double ultotal,
 
1748
                double ulnow)
1748
1749
{
1749
1750
  /* The original progress-bar source code was written for curl by Lars Aas,
1750
1751
     and this new edition inherites some of his concepts. */
1763
1764
 
1764
1765
  bar->point = dlnow + ulnow; /* we've come this far */
1765
1766
 
 
1767
  bar->calls++; /* simply count invokes */
 
1768
 
1766
1769
  if(0 == total) {
1767
1770
    int prevblock = bar->prev / 1024;
1768
1771
    int thisblock = bar->point / 1024;
2403
2406
      
2404
2407
      res = curl_easy_perform(curl);
2405
2408
        
 
2409
      if((config->progressmode == CURL_PROGRESS_BAR) &&
 
2410
         progressbar.calls) {
 
2411
        /* if the custom progress bar has been displayed, we output a
 
2412
           newline here */
 
2413
        fputs("\n", progressbar.out);
 
2414
      }
 
2415
 
2406
2416
      if(config->writeout) {
2407
2417
        ourWriteOut(curl, config->writeout);
2408
2418
      }