示例#1
0
        // You must still call ForceCancelRequest after this.
        internal unsafe void SetResetCode(int errorCode)
        {
            if (!HttpApi.SupportsReset)
            {
                return;
            }

            try
            {
                var streamError = new HttpApiTypes.HTTP_REQUEST_PROPERTY_STREAM_ERROR()
                {
                    ErrorCode = (uint)errorCode
                };
                var statusCode = HttpApi.HttpSetRequestProperty(Server.RequestQueue.Handle, Request.RequestId, HttpApiTypes.HTTP_REQUEST_PROPERTY.HttpRequestPropertyStreamError, (void *)&streamError,
                                                                (uint)sizeof(HttpApiTypes.HTTP_REQUEST_PROPERTY_STREAM_ERROR), IntPtr.Zero);
            }
            catch (ObjectDisposedException)
            {
                // RequestQueueHandle may have been closed
            }
        }