| 1 |
appaji-guest |
2 |
/********************************************************************\
|
| 2 |
|
|
* Axel -- A lighter download accelerator for Linux and other Unices. *
|
| 3 |
|
|
* *
|
| 4 |
|
|
* Copyright 2001 Wilmer van der Gaast *
|
| 5 |
|
|
\********************************************************************/
|
| 6 |
|
|
|
| 7 |
|
|
/* Connection stuff */
|
| 8 |
|
|
|
| 9 |
|
|
/*
|
| 10 |
|
|
This program is free software; you can redistribute it and/or modify
|
| 11 |
|
|
it under the terms of the GNU General Public License as published by
|
| 12 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
| 13 |
|
|
(at your option) any later version.
|
| 14 |
|
|
|
| 15 |
|
|
This program is distributed in the hope that it will be useful,
|
| 16 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 17 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 18 |
|
|
GNU General Public License for more details.
|
| 19 |
|
|
|
| 20 |
|
|
You should have received a copy of the GNU General Public License with
|
| 21 |
|
|
the Debian GNU/Linux distribution in file /usr/doc/copyright/GPL;
|
| 22 |
|
|
if not, write to the Free Software Foundation, Inc., 59 Temple Place,
|
| 23 |
|
|
Suite 330, Boston, MA 02111-1307 USA
|
| 24 |
|
|
*/
|
| 25 |
|
|
|
| 26 |
|
|
#define PROTO_FTP 1
|
| 27 |
|
|
#define PROTO_HTTP 2
|
| 28 |
|
|
#define PROTO_DEFAULT PROTO_FTP
|
| 29 |
|
|
|
| 30 |
|
|
typedef struct
|
| 31 |
|
|
{
|
| 32 |
|
|
conf_t *conf;
|
| 33 |
|
|
|
| 34 |
|
|
int proto;
|
| 35 |
|
|
int port;
|
| 36 |
|
|
int proxy;
|
| 37 |
|
|
char host[MAX_STRING];
|
| 38 |
|
|
char dir[MAX_STRING];
|
| 39 |
|
|
char file[MAX_STRING];
|
| 40 |
|
|
char user[MAX_STRING];
|
| 41 |
|
|
char pass[MAX_STRING];
|
| 42 |
|
|
|
| 43 |
|
|
ftp_t ftp[1];
|
| 44 |
|
|
http_t http[1];
|
| 45 |
appaji-guest |
25 |
long long size; /* File size, not 'connection size'.. */
|
| 46 |
|
|
long long currentbyte;
|
| 47 |
|
|
long long lastbyte;
|
| 48 |
appaji-guest |
2 |
int fd;
|
| 49 |
|
|
int enabled;
|
| 50 |
|
|
int supported;
|
| 51 |
|
|
int last_transfer;
|
| 52 |
|
|
char *message;
|
| 53 |
|
|
char *local_if;
|
| 54 |
|
|
|
| 55 |
|
|
int state;
|
| 56 |
|
|
pthread_t setup_thread[1];
|
| 57 |
|
|
} conn_t;
|
| 58 |
|
|
|
| 59 |
|
|
int conn_set( conn_t *conn, char *set_url );
|
| 60 |
|
|
char *conn_url( conn_t *conn );
|
| 61 |
|
|
void conn_disconnect( conn_t *conn );
|
| 62 |
|
|
int conn_init( conn_t *conn );
|
| 63 |
|
|
int conn_setup( conn_t *conn );
|
| 64 |
|
|
int conn_exec( conn_t *conn );
|
| 65 |
|
|
int conn_info( conn_t *conn );
|