共用方式為


3.3.4.2 Sending an Interim Response for an Asynchronous Operation

The server MAY<239> choose to send an interim response for any request that is received. It SHOULD<240> send an interim response for any request that could potentially block for an indefinite amount of time. If an operation would require asynchronous processing but resources are constrained, the server MAY<241> choose to fail that operation with STATUS_INSUFFICIENT_RESOURCES.

An interim response indicates to the client that the request has been received and a full response will come later. The server SHOULD NOT sign an interim response.

To send an interim response for a request, the server MUST generate an asynchronous identifier for it, and Request.AsyncId MUST be set to this asynchronous identifier.

  • The identifier MUST be an 8-byte value.

  • The identifier MUST be unique for all outstanding asynchronous requests on a specified SMB2 transport connection.

  • The identifier MUST remain valid until the final response for the request is sent.

  • The identifier MUST NOT be reused until the final response is sent.

  • The identifier MUST be nonzero.

The server MUST insert the Request in Connection.AsyncCommandList.

The server MUST construct a response packet for the request. The SMB2 header of the response MUST be identical to that in the request with the following changes:

  • It MUST set the Status field in the SMB2 header to STATUS_PENDING.

  • The NextCommand field MUST be set to 0 if this is not a compounded response. Otherwise, NextCommand MUST be set as specified in section 3.3.4.1.3.

  • The server MUST set the SMB2_FLAGS_SERVER_TO_REDIR bit in the Flags field of the SMB2 header.

  • The server MUST set the SMB2_FLAGS_ASYNC_COMMAND bit in the Flags field of the SMB2 header.

  • It MUST set the AsyncId field of the SMB2 header to the value that was generated earlier.

  • It MUST set the CreditResponse field to the number of credits the server chooses to grant for this request, as specified in section 3.3.1.2.

It MUST append an SMB2 ERROR Response following the SMB2 header, as specified in section 2.2.2, with a ByteCount of zero. This response MUST be sent to the client.