2 ** \file HttpBaseSocket.h
4 ** \author grymse@alhem.net
7 Copyright (C) 2007 Anders Hedstrom
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #ifndef _HttpBaseSocket_H
24 #define _HttpBaseSocket_H
26 #include "HTTPSocket.h"
27 #include "HttpRequest.h"
28 #include "IHttpServer.h"
30 #ifdef SOCKETS_NAMESPACE
31 namespace SOCKETS_NAMESPACE
{
37 class HttpBaseSocket
: public HTTPSocket
, public IHttpServer
40 HttpBaseSocket(ISocketHandler
& h
);
44 void OnHeader(const std::string
& key
,const std::string
& value
);
45 void OnHeaderComplete();
46 void OnData(const char *,size_t);
48 // implements IHttpServer::Respond
49 void Respond(const HttpResponse
& res
);
51 void OnTransferLimit();
54 HttpBaseSocket(const HttpBaseSocket
& s
) : HTTPSocket(s
) {} // copy constructor
60 HttpBaseSocket
& operator=(const HttpBaseSocket
& ) { return *this; } // assignment operator
63 size_t m_body_size_left
;
64 const IFile
*m_res_file
;
71 #ifdef SOCKETS_NAMESPACE
72 } // namespace SOCKETS_NAMESPACE {
75 #endif // _HttpBaseSocket_H