/[axel]/trunk/axel.c
ViewVC logotype

Diff of /trunk/axel.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 13 by appaji-guest, Tue Jan 15 16:11:35 2008 UTC revision 14 by appaji-guest, Wed Jan 16 07:56:47 2008 UTC
# Line 64  axel_t *axel_new( conf_t *conf, int coun Line 64  axel_t *axel_new( conf_t *conf, int coun
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          {          {
# Line 72  axel_t *axel_new( conf_t *conf, int coun Line 72  axel_t *axel_new( conf_t *conf, int coun
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 ) );
# Line 96  axel_t *axel_new( conf_t *conf, int coun Line 96  axel_t *axel_new( conf_t *conf, int coun
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    
# Line 119  axel_t *axel_new( conf_t *conf, int coun Line 119  axel_t *axel_new( conf_t *conf, int coun
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 )
# Line 128  axel_t *axel_new( conf_t *conf, int coun Line 128  axel_t *axel_new( conf_t *conf, int coun
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  }  }

Legend:
Removed from v.13  
changed lines
  Added in v.14

  ViewVC Help
Powered by ViewVC 1.1.5