3.2.5.1 Receiving a PeerDist-Supporting Request

If the HTTP/1.1 server uses the PeerDist content encoding for its response, then the server MUST construct for the requested content, a Content Information Data Structure as specified in [MS-PCCRC] section 2.3, using the algorithms described in [MS-PCCRC] sections 2.1 and 2.2, and place such a structure in the response message as an encoded entity-body.

If the X-P2P-PeerDistEx header is present, the server MUST generate and respond with a Content Information Data Structure whose version falls within the range specified by the MinContentInformation and MaxContentInformation parameters. If the values of MinContentInformation and MaxContentInformation do not fall within the range specified in section 2.2, the server MUST not generate and respond with a Content Information Data Structure, and MUST respond with another client-supported encoding as defined in [RFC2616]. If no X-P2P-PeerDistEx extension header was present, then the server MUST respond with a version 1.0 Content Information Data Structure.

It MUST also include the PeerDist parameters header field in the response. The PeerDist parameters header field MUST contain the Version parameter containing the version of the PeerDist content encoding used in the response. As shown in the following example, the PeerDist parameters header field MUST also contain the ContentLength parameter specifying the content length of the response entity-body before the PeerDist content encoding has been applied to it.

  
 Content-Encoding: PeerDist
 X-P2P-PeerDist: Version=1.0, ContentLength=102400
  

If the HTTP/1.1 server sends a PeerDist-encoded response entity-body, it MUST encode the entity-body into segments and blocks as specified in [MS-PCCRC] section 2, and then use that encoding to construct a Content Information Data Structure, as specified in [MS-PCCRC] section 2.3. It MUST then use this latter data structure as the PeerDist-encoded response entity-body.

If the HTTP/1.1 server does not have the Content Information Data Structure available for the content requested by the client, for such reasons as this is the first request for the content, then the server SHOULD send a response containing the original content and add the X-P2P-PeerDistEx header with MakeHashRequest set to true. This indicates to the client to make an additional request for the content hashes.

The HTTP/1.1 server MAY<6> choose to use the algorithms and data structures defined in [MS-PCCRC] on the response entity-body before sending it to the HTTP/1.1 client. Furthermore, it MAY<7> send the Connection header field with a value of "close" to require the HTTP/1.1 client not to use the same connection for future HTTP requests. The HTTP/1.1 server SHOULD NOT<8> send the Connection header field in its response if the HTTP/1.1 client is known to be unable to handle the Connection header field gracefully, as specified in section 3.1.5.1.