3.2.5.4 MSG_GETSEGLIST Request Received

On receiving a valid MSG_GETSEGLIST (section 3.1.5.4) request message from a client, the server MUST perform the following actions in the order specified:

  1. The server MUST first check if the protocol version is supported, based on the version range comparison rules specified in section 3.1.5.1. If the major protocol version is outside the range of the server implementation, the server MUST construct an MSG_NEGO_RESP (section 2.2.5.1) message, including the maximum and minimum protocol versions it supports, and send the MSG_NEGO_RESP message back to the client.

  2. If the major version is supported by the server, the server MUST select a compatible protocol version based on the same rules specified in section 3.1.5.1 for the following reply message.

  3. The server MUST check whether its Active Client Count is greater than or equal to the maximum number allowed. If the server peer-to-peer (P2P) is already serving the maximum number of clients or more, the server MUST reply to the client using a MSG_SEGLIST (section 2.2.5.4) message with an empty segment range.

  4. Otherwise, the server MUST increment the Active Client Count by 1, set the Upload Timer, and retrieve the availability in the server's Content Cache for each of the segments specified in the GetSegmentList request. Based on the availability of these segments, the server MUST build an array of ranges identifying the segments partially or fully available in the local cache, by identifying each segment with the index of its segment ID in the array of segment IDs contained in the originating GetSegmentList request. The server MUST then send the client a MSG_SEGLIST response message containing the array of segment ranges just calculated (possibly empty).

  5. Once the MSG_SEGLIST response message is sent, the server MUST decrement the Active Client Count by 1.