Browse Source

Add check so that we don't connect to more peers than we should.

master
Richard Nyberg 19 years ago
parent
commit
96d68439bb
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      btpd/tracker_req.c

+ 2
- 1
btpd/tracker_req.c View File

@@ -115,7 +115,8 @@ tracker_done(struct child *child)
if (error == EINVAL) {
error = benc_dget_str(req->res->buf, "peers", &peers, &length);
if (error == 0 && length % 6 == 0) {
for (size_t i = 0; i < length; i += 6)
size_t i;
for (i = 0; i < length && btpd.npeers < btpd.maxpeers; i += 6)
peer_create_out_compact(tp, peers + i);
}
}


Loading…
Cancel
Save