소스 검색

Accept pieces even if they arrive in a different order than the

requests were sent.
master
Richard Nyberg 19 년 전
부모
커밋
a263d2f9f6
1개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. +7
    -5
      btpd/peer.c

+ 7
- 5
btpd/peer.c 파일 보기

@@ -408,11 +408,13 @@ void
peer_on_piece(struct peer *p, uint32_t index, uint32_t begin, peer_on_piece(struct peer *p, uint32_t index, uint32_t begin,
uint32_t length, const char *data) uint32_t length, const char *data)
{ {
struct block_request *req = BTPDQ_FIRST(&p->my_reqs); struct block_request *req;
if ((req != NULL && BTPDQ_FOREACH(req, &p->my_reqs, p_entry)
nb_get_begin(req->blk->msg) == begin && if ((nb_get_begin(req->blk->msg) == begin &&
nb_get_index(req->blk->msg) == index && nb_get_index(req->blk->msg) == index &&
nb_get_length(req->blk->msg) == length)) { nb_get_length(req->blk->msg) == length))
break;
if (req != NULL) {
btpd_log(BTPD_L_MSG, "received piece(%u,%u,%u) from %p\n", btpd_log(BTPD_L_MSG, "received piece(%u,%u,%u) from %p\n",
index, begin, length, p); index, begin, length, p);
assert(p->nreqs_out > 0); assert(p->nreqs_out > 0);


||||||
x
 
000:0
불러오는 중...
취소
저장