Opened 12 years ago

Closed 12 years ago

#2635 closed Bug (fixed)

wrong peer progress update

Reported by: sadface Owned by: charles
Priority: Normal Milestone:
Component: libtransmission Version: 1.76+
Severity: Normal Keywords:
Cc:

Description

I've noticed that peer progress is 0.99x instead of 1.0 on most of the seeds.

When a HAVE message is received, tr_bitsetAdd() resizes the bitfield. Later, tr_bitsetPercent() found that bitfield.bitCount == torrent->info.pieceCount +1.

Change History (7)

comment:1 Changed 12 years ago by charles

  • Milestone changed from None Set to 1.80
  • Status changed from new to assigned

comment:2 Changed 12 years ago by charles

At first I thought this was an off-by-one in tr_bitsetAdd(), but I wonder if it's not coming from peer-msgs.c:1439, which calls tr_bitfieldReserve(bitfield,msglen*8) when it gets a BT_BITFIELD. I won't be able to test either case for about 6 hours, so I'm taking these notes to either (a) remind myself later or (b) point sadface or anyone else in the right direction if they want to test. ;)

The reason the array is allocated on the byte level there is because if we're dealing with magnet links we might not know how many bits really belong in the bitfield. This line in peer-msgs.c is clumsy though -- for non-magnets we /do/ know the piece count and should use that instead of msglen*8.

comment:3 Changed 12 years ago by charles

charles * r9659 libtransmission/peer-msgs.c: (trunk libT) #2636: "wrong peer progress update" -- possible fix as described in comment:2

comment:4 follow-up: Changed 12 years ago by charles

sadface: does r9659 work for you?

comment:5 Changed 12 years ago by KyleK

Minor quibble, but the commit msg for r9659 contains a link to ticket #2636, which is wrong. It should be #2635.

Not sure if this can still be changed (just for consistency).

comment:6 in reply to: ↑ 4 ; follow-up: Changed 12 years ago by sadface

Replying to charles:

sadface: does r9659 work for you?

Yes, it works fine.

Sorry for my vague diagnosis.

comment:7 in reply to: ↑ 6 Changed 12 years ago by charles

  • Milestone 1.80 deleted
  • Resolution set to fixed
  • Status changed from assigned to closed

Replying to sadface:

Yes, it works fine.

Glad to hear it :)

Sorry for my vague diagnosis.

Not a problem. It looked like an off-by-one to me too.

Note: See TracTickets for help on using tickets.