public override void FlushResponse(bool finalFlush) { if (_responseStatus == 404 && !_headersSent && finalFlush && _verb == "GET") { // attempt directory listing if (ProcessDirectoryListingRequest()) { return; } } _connectionPermission.Assert(); if (!_headersSent) { _connection.WriteHeaders(_responseStatus, _responseHeadersBuilder.ToString()); _headersSent = true; } for (int i = 0; i < _responseBodyBytes.Count; i++) { byte[] bytes = _responseBodyBytes[i]; _connection.WriteBody(bytes, 0, bytes.Length); } _responseBodyBytes = new List<byte[]>(); if (finalFlush) { _connection.Close(); } }
public override void FlushResponse(bool finalFlush) { if (!_headersSent) { _conn.WriteHeaders(_responseStatus, _responseHeadersBuilder.ToString()); _headersSent = true; } for (int i = 0; i < _responseBodyBytes.Count; i++) { byte[] bytes = (byte[])_responseBodyBytes[i]; _conn.WriteBody(bytes, 0, bytes.Length); } _responseBodyBytes = new ArrayList(); if (finalFlush) { _conn.Close(); } }