Pārlūkot izejas kodu

Always update the tlib info when a torrent is stopped. Some code shuffle.

master
Richard Nyberg pirms 18 gadiem
vecāks
revīzija
110b1d7e22
1 mainītis faili ar 5 papildinājumiem un 4 dzēšanām
  1. +5
    -4
      btpd/torrent.c

+ 5
- 4
btpd/torrent.c Parādīt failu

@@ -156,12 +156,14 @@ torrent_kill(struct torrent *tp)
assert(!(tr_active(tp) || net_active(tp) || cm_active(tp))); assert(!(tr_active(tp) || net_active(tp) || cm_active(tp)));
m_ntorrents--; m_ntorrents--;
BTPDQ_REMOVE(&m_torrents, tp, entry); BTPDQ_REMOVE(&m_torrents, tp, entry);
tr_kill(tp); if (!tp->delete)
net_kill(tp); tlib_update_info(tp->tl);
cm_kill(tp);
tp->tl->tp = NULL; tp->tl->tp = NULL;
if (tp->delete) if (tp->delete)
tlib_del(tp->tl); tlib_del(tp->tl);
tr_kill(tp);
net_kill(tp);
cm_kill(tp);
mi_free_files(tp->nfiles, tp->files); mi_free_files(tp->nfiles, tp->files);
free(tp); free(tp);
if (m_ntorrents == 0) if (m_ntorrents == 0)
@@ -174,7 +176,6 @@ torrent_stop(struct torrent *tp)
int tra, cma; int tra, cma;
switch (tp->state) { switch (tp->state) {
case T_ACTIVE: case T_ACTIVE:
tlib_update_info(tp->tl);
case T_STARTING: case T_STARTING:
tp->state = T_STOPPING; tp->state = T_STOPPING;
if (net_active(tp)) if (net_active(tp))


||||||
x
 
000:0
Notiek ielāde…
Atcelt
Saglabāt