File src/dinoex_curl.c

* by Dirk Meyer (dinoex) * Copyright (C) 2004-2011 Dirk Meyer * * By using this file, you agree to the terms and conditions set * forth in the GNU General Public License. More information is * available in the LICENSE file. * * If you received this file without documentation, it can be * downloaded from http://iroffer.dinoex.net/ * * $Id: dinoex_curl.c,v 1.30 2012/06/30 10:20:26 cvs Exp $ *


Included Files

include the headers


Preprocessor definitions

#define _LONGLONG 1

Typedef fetch_curl_t

typedef struct {...} fetch_curl_t
struct  
   {  
      userinput u;  
      unsigned int id;  
      unsigned int net;  
      char* name;  
      char* url;  
      char* vhosttext;  
      FILE* writefd;  
      off_t resumesize;  
      char* errorbuf;  
      CURL* curlhandle;  
      time_t starttime;  
   }  

Global Variable fetch_started

int fetch_started
Visible in:   src/dinoex_admin.c
    src/dinoex_curl.c
    src/dinoex_misc.c
    src/dinoex_upload.c
    src/iroffer_admin.c
    src/iroffer_main.c
Used in: clean_fetch() src/dinoex_curl.c
  curl_startup() src/dinoex_curl.c
  fetch_cancel() src/dinoex_curl.c
  fetch_perform() src/dinoex_curl.c
  start_fetch_url() src/dinoex_curl.c
  u_dcl() src/iroffer_admin.c
  u_dcld() src/iroffer_admin.c

Global Variable curl_strequal

curl_strequal() and curl_strnequal() are subject for removal in a future libcurl, see lib/README.curlx for details

int ( curl_strequal)(const char* s1,const char* s2)

Included from /usr/local/include/curl/curl.h
Visible in:   src/dinoex_curl.c

Global Variable curl_strnequal

int ( curl_strnequal)(const char* s1,const char* s2,size_t n)
Included from /usr/local/include/curl/curl.h
Visible in:   src/dinoex_curl.c

Local Variables

cm
static CURLM* cm
Used in: curl_fetch()  
  curl_shutdown()  
  curl_startup()  
  fetch_cancel()  
  fetch_multi_fdset()  
  fetch_perform()  

fetch_trans
static irlist_t fetch_trans

Used in: clean_fetch()  
  curl_startup()  
  dinoex_dcl()  
  dinoex_dcld()  
  fetch_cancel()  
  fetch_is_running()  
  fetch_perform()  
  start_fetch_url()  

fetch_id
static unsigned int fetch_id

Used in: clean_fetch()  
  curl_startup()  
  start_fetch_url()  

Global Function curl_shutdown()

close the curl lib

void curl_shutdown ( void )

Prototyped in: src/dinoex_curl.h
Calls: curl_global_cleanup(), curl_multi_cleanup()
Called by: shutdown_dinoex() src/dinoex_misc.c
References Variables: cm src/dinoex_curl.c

Global Function curl_startup()

setup the curl lib

void curl_startup ( void )

Prototyped in: src/dinoex_curl.h
Calls: ioutput() src/iroffer_utilities.c
  bzero(), curl_global_init(), curl_multi_init()
Called by: startup_dinoex() src/dinoex_misc.c
References Variables: cm src/dinoex_curl.c
  fetch_id src/dinoex_curl.c
  fetch_started src/dinoex_curl.c
  fetch_trans src/dinoex_curl.c

Global Function dinoex_dcl()

show running transfers

void dinoex_dcl ( const userinput* const u )

Prototyped in: src/dinoex_curl.h
Calls: a_respond() src/dinoex_admin.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  curl_easy_getinfo()
Called by: u_dcl() src/iroffer_admin.c
References Variables: fetch_trans src/dinoex_curl.c

Global Function dinoex_dcld()

show running transfers in detail

void dinoex_dcld ( const userinput* const u )

Prototyped in: src/dinoex_curl.h
Calls: a_respond() src/dinoex_admin.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  curl_easy_getinfo()
Called by: u_dcld() src/iroffer_admin.c
References Variables: fetch_trans src/dinoex_curl.c
  gdata src/dinoex_main.c

Global Function fetch_cancel()

cancel a running fetch command

unsigned int fetch_cancel ( unsigned int num )

Prototyped in: src/dinoex_curl.h
Calls: a_respond() src/dinoex_admin.c
  clean_fetch() src/dinoex_curl.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  outerror() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  curl_multi_remove_handle()
Called by: a_fetchcancel() src/dinoex_admin.c
References Variables: cm src/dinoex_curl.c
  fetch_started src/dinoex_curl.c
  fetch_trans src/dinoex_curl.c

Global Function fetch_is_running()

check if a file is already in transfer

unsigned int fetch_is_running ( const char* file )

Prototyped in: src/dinoex_curl.h
Calls: irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  strcmp()
Called by: file_uploading() src/dinoex_upload.c
References Variables: fetch_trans src/dinoex_curl.c

Global Function fetch_multi_fdset()

register active connections for select()

void fetch_multi_fdset ( fd_set* read_fd_set, fd_set* write_fd_set, fd_set* exc_fd_set, int* max_fd )

Prototyped in: src/dinoex_curl.h
Calls: outerror() src/iroffer_utilities.c
  curl_multi_fdset()
Called by: mainloop() src/iroffer_main.c
References Variables: cm src/dinoex_curl.c

Global Function fetch_perform()

process all running connections

void fetch_perform ( void )

Prototyped in: src/dinoex_curl.h
Calls: a_respond() src/dinoex_admin.c
  clean_fetch() src/dinoex_curl.c
  do_myruby_upload_done() src/dinoex_ruby.c
  irlist_get_head() src/iroffer_utilities.c
  irlist_get_next() src/iroffer_utilities.c
  outerror() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  curl_multi_info_read(), curl_multi_perform()
Called by: mainloop() src/iroffer_main.c
References Variables: cm src/dinoex_curl.c
  fetch_started src/dinoex_curl.c
  fetch_trans src/dinoex_curl.c
  gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Global Function start_fetch_url()

start a transfer

void start_fetch_url ( const userinput* const u, const char* uploaddir )

Prototyped in: src/dinoex_curl.h
Calls: a_respond() src/dinoex_admin.c
  clean_fetch() src/dinoex_curl.c
  curl_fetch() src/dinoex_curl.c
  irlist_add2() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  mymalloc2() src/iroffer_utilities.c
  mystrdup2() src/dinoex_utilities.c
  mystrjoin2() src/dinoex_utilities.c
  outerror() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  __error(), fopen(), stat(), strerror()
Called by: a_fetch() src/dinoex_admin.c
References Variables: fetch_id src/dinoex_curl.c
  fetch_started src/dinoex_curl.c
  fetch_trans src/dinoex_curl.c
  gdata src/dinoex_main.c
  gnetwork src/dinoex_main.c

Local Function clean_fetch()

static fetch_curl_t* clean_fetch ( fetch_curl_t* ft )
Calls: irlist_delete() src/iroffer_utilities.c
  mydelete2() src/iroffer_utilities.c
  updatecontext_f() src/iroffer_utilities.c
  curl_easy_cleanup(), fclose()
Called by: fetch_cancel() src/dinoex_curl.c
  fetch_perform() src/dinoex_curl.c
  start_fetch_url() src/dinoex_curl.c
References Variables: fetch_id src/dinoex_curl.c
  fetch_started src/dinoex_curl.c
  fetch_trans src/dinoex_curl.c

Local Function curl_fetch()

static unsigned int curl_fetch ( const userinput* const u, fetch_curl_t* ft )
Calls: a_respond() src/dinoex_admin.c
  curl_respond() src/dinoex_curl.c
  updatecontext_f() src/iroffer_utilities.c
  curl_easy_init(), curl_easy_setopt(), curl_multi_add_handle()
Called by: start_fetch_url() src/dinoex_curl.c
References Variables: cm src/dinoex_curl.c

Local Function curl_respond()

static void curl_respond ( const userinput* const u, const char* text, CURLcode ces )
Calls: a_respond() src/dinoex_admin.c
Called by: curl_fetch() src/dinoex_curl.c