Changeset 5607 for wire/trunk

Show
Ignore:
Timestamp:
07/22/08 11:00:56 (1 month ago)
Author:
morris
Message:

Fix a few problems with recursive downloads

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wire/trunk/Makefile.in

    r5037 r5607  
    1818SUBDIRS                 = libwired 
    1919 
    20 WIREOBJECTS             = $(addprefix $(objdir)/wire/,$(notdir $(patsubst %.c,%.o,$(shell find $(abs_top_srcdir)/wire -name "*.c")))) 
     20WIREOBJECTS             = $(addprefix $(objdir)/wire/,$(notdir $(patsubst %.c,%.o,$(shell find $(abs_top_srcdir)/wire -name "[a-z]*.c")))) 
    2121 
    2222DEFS                    = @DEFS@ 
  • wire/trunk/wire/transfers.c

    r5599 r5607  
    343343         
    344344        local_path = wi_string_by_appending_path_component(wi_string_by_normalizing_path(wr_download_path), local_path); 
    345          
     345        parent_path = wi_string_by_deleting_last_path_component(local_path); 
     346         
     347        wi_file_create_directory(parent_path, 0755); 
     348 
    346349        if(wr_file_type(file) == WR_FILE_FILE) { 
    347350                wi_array_add_data(transfer->remote_paths, remote_path); 
     
    351354                transfer->total_size += wr_file_size(file); 
    352355        } else { 
    353                 parent_path = wi_string_by_deleting_last_path_component(local_path); 
    354  
    355                 wi_file_create_directory(parent_path, 0755); 
    356                  
    357356                if(!wi_file_exists(local_path, NULL)) { 
     357                        wi_log_info(WI_STR("create %@"), local_path); 
     358 
    358359                        if(!wi_file_create_directory(local_path, 0755)) { 
    359360                                wr_printf_prefix(WI_STR("get: Unable to create directory at %@: %m"), 
     
    540541        wi_file_stat_t          sb; 
    541542 
     543        if(wi_array_count(transfer->local_paths) == 0) { 
     544                wr_transfer_start_next_or_stop(transfer); 
     545                 
     546                return; 
     547        } 
     548 
    542549        if(transfer->type == WR_TRANSFER_DOWNLOAD) { 
    543550                local_path = wi_array_first_data(transfer->local_paths); 
     
    589596                        transfer->file_offset); 
    590597        } else { 
    591                 if(wi_array_count(transfer->local_paths) == 0) { 
    592                         wr_transfer_start_next_or_stop(transfer); 
    593                          
    594                         return; 
    595                 } 
    596                  
    597598                local_path = wi_array_first_data(transfer->local_paths); 
    598599