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;
 }
        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);
            }
        }
 public GateWorkerRequest(CrossAppDomainRequestData requestData, CrossAppDomainResponseData responseData)
 {
     _requestData  = requestData;
     _responseData = responseData;
     _ended        = new ManualResetEventSlim();
 }
 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);
            }
        }