reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
HttpBase.hxx
Go to the documentation of this file.
1#if !defined(REPRO_HTTPBASE_HXX)
2#define REPRO_HTTPBASE_HXX
3
4#include "rutil/Data.hxx"
5#include "rutil/Socket.hxx"
9
10namespace repro
11{
12class HttpConnection;
13
15{
16 friend class HttpConnection;
17
18 public:
19 HttpBase( int port, resip::IpVersion version, const resip::Data& realm, const resip::Data& ipAddr = resip::Data::Empty );
20 virtual ~HttpBase();
21
24
25 bool isSane();
26
27 protected:
28 virtual void buildPage( const resip::Data& method,
29 const resip::Data& uri,
30 int pageNumber,
31 const resip::Data& user,
32 const resip::Data& password )=0;
33 void setPage( const resip::Data& page,
34 int pageNumber,
35 int response=200,
36 const resip::Mime& pType = resip::Mime("text","html") );
37
39
40 private:
41 static const int MaxConnections = 30;
42
43 resip::Socket mFd;
44 int nextConnection;
45 resip::Tuple mTuple;
46
47 bool sane;
48
49 HttpConnection* mConnection[MaxConnections];
50
51};
52
53}
54
55#endif
56
57/* ====================================================================
58 * The Vovida Software License, Version 1.0
59 *
60 * Copyright (c) 2026 SIP Spectrum, Inc. https://www.sipspectrum.com
61 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
62 *
63 * Redistribution and use in source and binary forms, with or without
64 * modification, are permitted provided that the following conditions
65 * are met:
66 *
67 * 1. Redistributions of source code must retain the above copyright
68 * notice, this list of conditions and the following disclaimer.
69 *
70 * 2. Redistributions in binary form must reproduce the above copyright
71 * notice, this list of conditions and the following disclaimer in
72 * the documentation and/or other materials provided with the
73 * distribution.
74 *
75 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
76 * and "Vovida Open Communication Application Library (VOCAL)" must
77 * not be used to endorse or promote products derived from this
78 * software without prior written permission. For written
79 * permission, please contact vocal@vovida.org.
80 *
81 * 4. Products derived from this software may not be called "VOCAL", nor
82 * may "VOCAL" appear in their name, without prior written
83 * permission of Vovida Networks, Inc.
84 *
85 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
86 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
87 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
88 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
89 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
90 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
91 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
92 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
93 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
94 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
95 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
96 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
97 * DAMAGE.
98 *
99 * ====================================================================
100 *
101 * This software consists of voluntary contributions made by Vovida
102 * Networks, Inc. and many individuals on behalf of Vovida Networks,
103 * Inc. For more information on Vovida Networks, Inc., please see
104 * <http://www.vovida.org/>.
105 *
106 */
Handles cross-platform sockets compatibility.
const resip::Data mRealm
Definition HttpBase.hxx:38
void setPage(const resip::Data &page, int pageNumber, int response=200, const resip::Mime &pType=resip::Mime("text","html"))
Definition HttpBase.cxx:220
void buildFdSet(resip::FdSet &fdset)
Definition HttpBase.cxx:149
virtual ~HttpBase()
Definition HttpBase.cxx:30
void process(resip::FdSet &fdset)
Definition HttpBase.cxx:164
virtual void buildPage(const resip::Data &method, const resip::Data &uri, int pageNumber, const resip::Data &user, const resip::Data &password)=0
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
static const Data Empty
Constant that represents a zero-length data.
Definition Data.hxx:882
Object-oriented wrapper for your platform's file-descriptor set.
Definition Socket.hxx:162
Represents the "media-type" element in the RFC 3261 grammar.
Definition Mime.hxx:20
Represents a network address.
Definition Tuple.hxx:59
This Class is used to implement a primitive form of RPC using loose XML formatting.
int Socket
Definition Socket.hxx:94
IpVersion
An enumeration of IP versions.
void list()
Definition userAdmin.cxx:66