コード例 #1
0
        private async Task ProcessResponse(IDictionary<string, object> environment, CrossAppDomainResponseData responseData) {
            if (responseData.StatusCode == 404) {
                await this._next(environment);
                return;
            }

            await this._converter.UpdateWithResponseData(environment, responseData);
        }
コード例 #2
0
 public CrossAppDomainResponseData ProcessRequest(CrossAppDomainRequestData requestData) {
     var responseData = new CrossAppDomainResponseData();
     // can be rewritten to support true async later on (beginrequest/endrequest)
     using (var request = new GateWorkerRequest(requestData, responseData)) {
         HttpRuntime.ProcessRequest(request);
         request.WaitForEnd();
     }
     return responseData;
 }
コード例 #3
0
        public async Task UpdateWithResponseData(IDictionary<string, object> environment, CrossAppDomainResponseData responseData) {
            var response = new OwinResponse(environment);
            response.StatusCode = responseData.StatusCode;
            response.ReasonPhrase = responseData.StatusDescription;

            foreach (var pair in responseData.Headers) {
                response.Headers.Add(pair.Key, new[] { pair.Value });
            }

            foreach (var data in responseData.Body) {
                await response.WriteAsync(data);
            }

            foreach (var file in responseData.Files) {
                await SendFileToResponse(response, file);
            }
        }
コード例 #4
0
 public GateWorkerRequest(CrossAppDomainRequestData requestData, CrossAppDomainResponseData responseData)
 {
     _requestData  = requestData;
     _responseData = responseData;
     _ended        = new ManualResetEventSlim();
 }
コード例 #5
0
 public GateWorkerRequest(CrossAppDomainRequestData requestData, CrossAppDomainResponseData responseData) {
     _requestData = requestData;
     _responseData = responseData;
     _ended = new ManualResetEventSlim();
 }
コード例 #6
0
        public async Task UpdateWithResponseData(IDictionary <string, object> environment, CrossAppDomainResponseData responseData)
        {
            var response = new OwinResponse(environment);

            response.StatusCode   = responseData.StatusCode;
            response.ReasonPhrase = responseData.StatusDescription;

            foreach (var pair in responseData.Headers)
            {
                response.Headers.Add(pair.Key, new[] { pair.Value });
            }

            foreach (var data in responseData.Body)
            {
                await response.WriteAsync(data);
            }

            foreach (var file in responseData.Files)
            {
                await SendFileToResponse(response, file);
            }
        }