Changeset 185 for SimpleHttpServer

Show
Ignore:
Timestamp:
07/29/07 03:36:04 (18 months ago)
Author:
mayuki
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • SimpleHttpServer/SimpleHttpServer/SimpleHttpServer.cs

    r184 r185  
     1// $Id$ 
     2#region LICENSE 
     3/* 
     4 * The MIT License 
     5 *  
     6 * Copyright © 2007 Mayuki Sawatari <mayuki@misuzilla.org> 
     7 *  
     8 * Permission is hereby granted, free of charge, to any person obtaining a copy 
     9 * of this software and associated documentation files (the "Software"), to deal 
     10 * in the Software without restriction, including without limitation the rights 
     11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
     12 * copies of the Software, and to permit persons to whom the Software is 
     13 * furnished to do so, subject to the following conditions: 
     14 *  
     15 * The above copyright notice and this permission notice shall be included in 
     16 * all copies or substantial portions of the Software. 
     17 *  
     18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
     19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
     20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
     21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
     22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
     23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
     24 * THE SOFTWARE. 
     25 */ 
     26#endregion 
    127using System; 
    228using System.Collections.Generic; 
     
    94120                else 
    95121                { 
    96                     // XXX: �܂������ 
     122                    // XXX: 折り返し非対応 
    97123                    String[] headerField = line.Split(new Char[] { ':' }, 2); 
    98124                    if (headerField.Length != 2) 
     
    120146 
    121147 
    122         #region IDisposable �����o 
     148        #region IDisposable メンバ 
    123149 
    124150        public void Dispose() 
     
    230256        } 
    231257 
    232         #region IDisposable �����o 
     258        #region IDisposable メンバ 
    233259 
    234260        public void Dispose() 
     
    243269    } 
    244270 
    245     #region HTTP �T�[�o�N���X 
     271    #region HTTP サーバクラス 
    246272    public delegate void RequestEventHandler(Context ctx); 
    247273    public class SimpleHttpServer 
     
    332358                    if (IPAddress.IsLoopback(((IPEndPoint)Context.Current.TcpClient.Client.RemoteEndPoint).Address)) 
    333359                    { 
    334                         sw.WriteLine("<h2>��</h2>"); 
     360                        sw.WriteLine("<h2>例外</h2>"); 
    335361                        sw.WriteLine("<pre>{0}</pre>", HttpUtility.HtmlEncode(he.ToString())); 
    336362                    } 
     
    378404                    sw.WriteLine("<title>500 Internal Server Error</title>"); 
    379405                    sw.WriteLine("<h1>500 Internal Server Error</h1>"); 
    380                     sw.WriteLine("<p>�T�[�o�ŏ�����s���ɃG���[���������܂����B</p>"); 
     406                    sw.WriteLine("<p>サーバで処理を実行中にエラーが発生しました。</p>"); 
    381407                    if (IPAddress.IsLoopback(((IPEndPoint)tcpClient.Client.RemoteEndPoint).Address)) 
    382408                    { 
    383                         sw.WriteLine("<h2>��</h2>"); 
     409                        sw.WriteLine("<h2>例外</h2>"); 
    384410                        sw.WriteLine("<pre>{0}</pre>", HttpUtility.HtmlEncode(e.ToString())); 
    385411                    } 
     
    478504    #endregion 
    479505 
    480     #region HttpStream �N���X 
     506    #region HttpStream クラス 
    481507    public class HttpStream : Stream 
    482508    {