| 64 |
{ |
{ |
| 65 |
axel->url = malloc( sizeof( url_t ) ); |
axel->url = malloc( sizeof( url_t ) ); |
| 66 |
axel->url->next = axel->url; |
axel->url->next = axel->url; |
| 67 |
strcpy( axel->url->text, (char *) url ); |
strncpy( axel->url->text, (char *) url, MAX_STRING ); |
| 68 |
} |
} |
| 69 |
else |
else |
| 70 |
{ |
{ |
| 72 |
u = axel->url = malloc( sizeof( url_t ) ); |
u = axel->url = malloc( sizeof( url_t ) ); |
| 73 |
for( i = 0; i < count; i ++ ) |
for( i = 0; i < count; i ++ ) |
| 74 |
{ |
{ |
| 75 |
strcpy( u->text, res[i].url ); |
strncpy( u->text, res[i].url, MAX_STRING ); |
| 76 |
if( i < count - 1 ) |
if( i < count - 1 ) |
| 77 |
{ |
{ |
| 78 |
u->next = malloc( sizeof( url_t ) ); |
u->next = malloc( sizeof( url_t ) ); |
| 96 |
axel->conn[0].local_if = axel->conf->interfaces->text; |
axel->conn[0].local_if = axel->conf->interfaces->text; |
| 97 |
axel->conf->interfaces = axel->conf->interfaces->next; |
axel->conf->interfaces = axel->conf->interfaces->next; |
| 98 |
|
|
| 99 |
strcpy( axel->filename, axel->conn[0].file ); |
strncpy( axel->filename, axel->conn[0].file, MAX_STRING ); |
| 100 |
http_decode( axel->filename ); |
http_decode( axel->filename ); |
| 101 |
if( *axel->filename == 0 ) /* Index page == no fn */ |
if( *axel->filename == 0 ) /* Index page == no fn */ |
| 102 |
strcpy( axel->filename, axel->conf->default_filename ); |
strncpy( axel->filename, axel->conf->default_filename, MAX_STRING ); |
| 103 |
if( ( s = strchr( axel->filename, '?' ) ) != NULL && axel->conf->strip_cgi_parameters ) |
if( ( s = strchr( axel->filename, '?' ) ) != NULL && axel->conf->strip_cgi_parameters ) |
| 104 |
*s = 0; /* Get rid of CGI parameters */ |
*s = 0; /* Get rid of CGI parameters */ |
| 105 |
|
|
| 119 |
return( axel ); |
return( axel ); |
| 120 |
} |
} |
| 121 |
s = conn_url( axel->conn ); |
s = conn_url( axel->conn ); |
| 122 |
strcpy( axel->url->text, s ); |
strncpy( axel->url->text, s, MAX_STRING ); |
| 123 |
if( ( axel->size = axel->conn[0].size ) != INT_MAX ) |
if( ( axel->size = axel->conn[0].size ) != INT_MAX ) |
| 124 |
{ |
{ |
| 125 |
if( axel->conf->verbose > 0 ) |
if( axel->conf->verbose > 0 ) |
| 128 |
|
|
| 129 |
/* Wildcards in URL --> Get complete filename */ |
/* Wildcards in URL --> Get complete filename */ |
| 130 |
if( strchr( axel->filename, '*' ) || strchr( axel->filename, '?' ) ) |
if( strchr( axel->filename, '*' ) || strchr( axel->filename, '?' ) ) |
| 131 |
strcpy( axel->filename, axel->conn[0].file ); |
strncpy( axel->filename, axel->conn[0].file, MAX_STRING ); |
| 132 |
|
|
| 133 |
return( axel ); |
return( axel ); |
| 134 |
} |
} |