소스 검색

In the transition to end game it's likely that we'll send an uniterest

message followed by an interest message. Optimize this but not sending
those messages in that case. This is better becasue we don't risk to
trigger a choke from the receiving peer.
master
Richard Nyberg 19 년 전
부모
커밋
faad18e368
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. +6
    -1
      btpd/peer.c

+ 6
- 1
btpd/peer.c 파일 보기

@@ -180,8 +180,13 @@ peer_want(struct peer *p, uint32_t index)
assert(p->nwant < p->npieces);
p->nwant++;
if (p->nwant == 1) {
int unsent = 0;
struct nb_link *nl = BTPDQ_LAST(&p->outq, nb_tq);
if (nl != NULL && nl->nb->type == NB_UNINTEREST)
unsent = peer_unsend(p, nl);
if (!unsent)
peer_send(p, btpd.interest_msg);
p->flags |= PF_I_WANT;
peer_send(p, btpd.interest_msg);
}
}



불러오는 중...
취소
저장