Changeset 2322

Show
Ignore:
Timestamp:
11/26/07 02:20:40 (14 months ago)
Author:
markybob
Message:

tweak last

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • tags/deluge-0.5.6.96/src/deluge_core.cpp

    r2321 r2322  
    253253        storage_mode = storage_mode_sparse; 
    254254    } 
    255     torrent_handle h = M_ses->add_torrent(t, save_path, resume_data, storage_mode); 
    256     //    h.set_max_connections(60); // at some point we should use this 
    257     h.set_max_uploads(-1); 
    258     h.set_ratio(preferred_ratio); 
    259     h.resolve_countries(true); 
    260     new_torrent.handle = h; 
    261  
    262     new_torrent.unique_ID = M_unique_counter; 
    263     M_unique_counter++; 
    264  
    265     M_torrents->push_back(new_torrent); 
    266  
    267     return (new_torrent.unique_ID); 
     255    try{ 
     256        torrent_handle h = M_ses->add_torrent(t, save_path, resume_data, storage_mode); 
     257        //    h.set_max_connections(60); // at some point we should use this 
     258        h.set_max_uploads(-1); 
     259        h.set_ratio(preferred_ratio); 
     260        h.resolve_countries(true); 
     261        new_torrent.handle = h; 
     262        new_torrent.unique_ID = M_unique_counter; 
     263        M_unique_counter++; 
     264        M_torrents->push_back(new_torrent); 
     265        return (new_torrent.unique_ID); 
     266    } 
     267    catch (invalid_encoding&) 
     268    { 
     269    printf("invalid encoding...bad torrent\n"); 
     270    } 
     271    catch (invalid_handle&) 
     272    { 
     273    printf("invalid handle.  something bad happened in libtorrent\n"); 
     274    } 
     275    catch (...) {} 
    268276} 
    269277 
     
    18101818      } 
    18111819    } 
     1820  catch (invalid_handle&) 
     1821  { 
     1822  printf("invalid handle.  something bad happened in libtorrent\n"); 
     1823  } 
    18121824  catch (...) {} 
    18131825  Py_INCREF(Py_None); return Py_None; 
  • trunk/src/deluge_core.cpp

    r2321 r2322  
    253253        storage_mode = storage_mode_sparse; 
    254254    } 
    255     torrent_handle h = M_ses->add_torrent(t, save_path, resume_data, storage_mode); 
    256     //    h.set_max_connections(60); // at some point we should use this 
    257     h.set_max_uploads(-1); 
    258     h.set_ratio(preferred_ratio); 
    259     h.resolve_countries(true); 
    260     new_torrent.handle = h; 
    261  
    262     new_torrent.unique_ID = M_unique_counter; 
    263     M_unique_counter++; 
    264  
    265     M_torrents->push_back(new_torrent); 
    266  
    267     return (new_torrent.unique_ID); 
     255    try{ 
     256        torrent_handle h = M_ses->add_torrent(t, save_path, resume_data, storage_mode); 
     257        //    h.set_max_connections(60); // at some point we should use this 
     258        h.set_max_uploads(-1); 
     259        h.set_ratio(preferred_ratio); 
     260        h.resolve_countries(true); 
     261        new_torrent.handle = h; 
     262        new_torrent.unique_ID = M_unique_counter; 
     263        M_unique_counter++; 
     264        M_torrents->push_back(new_torrent); 
     265        return (new_torrent.unique_ID); 
     266    } 
     267    catch (invalid_encoding&) 
     268    { 
     269    printf("invalid encoding...bad torrent\n"); 
     270    } 
     271    catch (invalid_handle&) 
     272    { 
     273    printf("invalid handle.  something bad happened in libtorrent\n"); 
     274    } 
     275    catch (...) {} 
    268276} 
    269277 
     
    18101818      } 
    18111819    } 
     1820  catch (invalid_handle&) 
     1821  { 
     1822  printf("invalid handle.  something bad happened in libtorrent\n"); 
     1823  } 
    18121824  catch (...) {} 
    18131825  Py_INCREF(Py_None); return Py_None;