New test.
[mono.git] / mcs / class / System.Web / System.Web / HttpResponse.cs
index 84e6b85291db9fe2f8c6d6cf47f82e907d5584b4..890078fb4a179bffa4567190965a291a6c06bc51 100644 (file)
@@ -590,7 +590,9 @@ namespace System.Web {
                                        // If we are not chunked, we need to set "Connection: close".
                                        //
                                        if (use_chunked){
+#if DEBUG
                                                Console.WriteLine ("Setting to close2");
+#endif
                                                write_headers.Add (new KnownResponseHeader (HttpWorkerRequest.HeaderConnection, "close"));
                                        }
                                }
@@ -600,7 +602,9 @@ namespace System.Web {
                                // close at the end.
                                //
                                if (use_chunked){
+#if DEBUG
                                        Console.WriteLine ("Setting to close");
+#endif
                                        write_headers.Add (new KnownResponseHeader (HttpWorkerRequest.HeaderConnection, "close"));
                                }
                        }
@@ -902,6 +906,7 @@ namespace System.Web {
                internal void TransmitFile (string filename, bool final_flush)
                {
                        FileInfo fi = new FileInfo (filename);
+                       using (Stream s = fi.OpenRead ()); // Just check if we can read.
                        output_stream.WriteFile (filename, 0, fi.Length);
                        output_stream.ApplyFilter (final_flush);
                        Flush (final_flush);