~ubuntu-branches/ubuntu/raring/curl/raring-updates

« back to all changes in this revision

Viewing changes to docs/examples/curlx.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Schuldei
  • Date: 2009-04-02 23:35:45 UTC
  • mto: (1.2.1 upstream) (3.2.3 sid)
  • mto: This revision was merged to the branch mainline in revision 38.
  • Revision ID: james.westby@ubuntu.com-20090402233545-geixkwhe3izccjt7
Tags: upstream-7.19.4
ImportĀ upstreamĀ versionĀ 7.19.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
281
281
  struct curl_slist * headers=NULL;
282
282
  int badarg=0;
283
283
 
284
 
  binaryptr=(char*)malloc(tabLength);
 
284
  binaryptr = malloc(tabLength);
285
285
 
286
286
  p.verbose = 0;
287
287
  p.errorbio = BIO_new_fp (stderr, BIO_NOCLOSE);
404
404
  /* determine URL to go */
405
405
 
406
406
  if (hostporturl) {
407
 
    serverurl=(char*) malloc(9+strlen(hostporturl));
 
407
    serverurl = malloc(9+strlen(hostporturl));
408
408
    sprintf(serverurl,"https://%s",hostporturl);
409
409
  }
410
410
  else if (p.accesstype != 0) { /* see whether we can find an AIA or SIA for a given access type */
442
442
 
443
443
  /* pass our list of custom made headers */
444
444
 
445
 
  contenttype=(char*) malloc(15+strlen(mimetype));
 
445
  contenttype = malloc(15+strlen(mimetype));
446
446
  sprintf(contenttype,"Content-type: %s",mimetype);
447
447
  headers = curl_slist_append(headers,contenttype);
448
448
  curl_easy_setopt(p.curl, CURLOPT_HTTPHEADER, headers);
469
469
      i+=lu;
470
470
      if (i== tabLength) {
471
471
        tabLength+=100;
472
 
        binaryptr=(char*)realloc(binaryptr,tabLength); /* should be more careful */
 
472
        binaryptr=realloc(binaryptr,tabLength); /* should be more careful */
473
473
      }
474
474
    }
475
475
    tabLength = i;