大网数据广告活动
网络与域名解析

Ack for Fragment

· 52CE 我爱测

Use the Ack for Fragment packet to acknowledge the client's Fragment request.

Use the Ack for Fragment packet to acknowledge the client's Fragment request.

reason-code reason-description
BITS-Packet-Type: Ack
BITS-Session-Id: {guid}
BITS-Received-Content-Range: range
BITS-Reply-URL: url
Content-Length: length
BITS-Error-Code: error-code
BITS-Error-Context: error-context

Headers

reason-code

Replace reason-code with an HTTP reason code. The following table shows the typical reason codes for a response to a Fragment request. For a list of HTTP reason codes, see RFC 2616.

Reason code Description
200 OK. The request was successful.
416 Range-Not-Satisfiable. The client sent a fragment whose range is not contiguous with the previous fragment.

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-Received-Content-Range

Zero-based offset to the next byte the server expects the client to send. For example, if the fragment contained the range 128 212, you would set range to 213.

BITS-Session-Id

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

BITS-Reply-URL

Contains the URL to the reply data of an upload-reply job. Include this header in the final fragment response after the upload is complete and you receive a response from the server application, if applicable.

Use the Content-Range header from the Fragment request to determine whether the upload is complete. The upload is complete if the end offset of the range value equals the total-length value minus one.

The BITS server posts the upload file to the server application after it determines the upload is complete. The server application processes the file and generates the reply. The BITS server sets the value of BITS-Reply-URL to the URL of the reply file from the server application.

Content-Length

Replace length with the number of bytes included in the body of the response. Content-Length is 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

If the session is for an upload-reply job, there may be a delay before the client receives the final Ack for Fragment response. The length of the delay depends on the amount of time the server application (application to which the server posts the upload file) takes to generate the reply.

See also

Create-Session

Fragment

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。