Ack for Cancel-Session

Use the Ack for Cancel-Session packet to acknowledge the client's Cancel-Session request. The server sends the acknowledgment after releasing all resources associated with the upload session.

reason-code reason-description
BITS-Packet-Type: Ack
BITS-Session-Id: {guid}
Content-Length: length
BITS-Error-Code: error-code
BITS-Error-Context: error-context

Headers

reason-code

Replace reason-code with the HTTP reason code. For example, set reason-code to 200 if success. For a list of HTTP reason codes, see RFC 2616.

reason-description

Replace reason-description with the HTTP description associated with the reason code. For example, set reason-description to OK if reason-code is 200.

BITS-Packet-Type

Identifies this response packet as an Ack packet.

BITS-Session-Id

String GUID that identifies the session to the client. Replace {guid} with the session identifier that the client sent in the Cancel-Session request packet. If you do not recognize the session identifier, set the BITS-Error-Code header to BG_E_SESSION_NOT_FOUND.

Content-Length

Replace length with the number of bytes included in the body of the response. Required even if the body of the response does not include content.

BITS-Error-Code

Replace error-code with a hexadecimal number that represents an HRESULT value associated with a server-side error. Only include this header if reason-code is not 200 or 201.

BITS-Error-Context

Replace error-context with a hexadecimal number that represents the context in which the error occurred. Specify the hexadecimal number for BG_ERROR_CONTEXT_REMOTE_FILE (0x5) if the server generated the error. Otherwise, specify the hexadecimal number for BG_ERROR_CONTEXT_REMOTE_APPLICATION (0x7) if the error was generated by the application to which the upload file is passed. Include this header only if the reason-code is not 200 or 201.

Remarks

The BITS client resends the Cancel-Session packet if the reason-code is in the range from 500 through 599, unless the BITS-Error-Code header is present with a value of BG_E_SESSION_NOT_FOUND. The client will not retry for reason codes 100 through 499.

See also

Ack for Close-Session

Cancel-Session