1
#if defined(HAVE_CONFIG_H)
5
#include "resip/stack/StatusLine.hxx"
6
#include "rutil/Data.hxx"
7
#include "rutil/DnsUtil.hxx"
8
#include "rutil/Logger.hxx"
9
#include "rutil/ParseBuffer.hxx"
10
//#include "rutil/WinLeakCheck.hxx" // not compatible with placement new used below
12
using namespace resip;
15
#define RESIPROCATE_SUBSYSTEM Subsystem::SIP
17
//====================
19
//====================
20
StatusLine::StatusLine()
23
mSipVersion(Data::Share,Symbols::DefaultSipVersion),
27
StatusLine::StatusLine(const HeaderFieldValue& hfv)
30
mSipVersion(Data::Share,Symbols::DefaultSipVersion),
34
StatusLine::StatusLine(const char* buf, int length) :
35
StartLine(buf, length),
37
mSipVersion(Data::Share,Symbols::DefaultSipVersion),
41
StatusLine::StatusLine(const StatusLine& rhs)
43
mResponseCode(rhs.mResponseCode),
44
mSipVersion(rhs.mSipVersion),
49
StatusLine::operator=(const StatusLine& rhs)
53
StartLine::operator=(rhs);
54
mResponseCode = rhs.mResponseCode;
55
mSipVersion = rhs.mSipVersion;
56
mReason = rhs.mReason;
62
StatusLine::clone() const
64
return new StatusLine(*this);
68
StatusLine::clone(void* location) const
70
return new (location) StatusLine(*this);
74
StatusLine::responseCode()
81
StatusLine::responseCode() const
88
StatusLine::statusCode()
95
StatusLine::statusCode() const
102
StatusLine::getSipVersion() const
116
StatusLine::reason() const
123
StatusLine::parse(ParseBuffer& pb)
125
const char* start = pb.skipWhitespace();
126
pb.skipNonWhitespace();
127
pb.data(mSipVersion, start);
129
start = pb.skipWhitespace();
130
mResponseCode = pb.integer();
131
start = pb.skipWhitespace();
133
pb.data(mReason, start);
137
StatusLine::encodeParsed(EncodeStream& str) const
139
str << mSipVersion << Symbols::SPACE
140
<< mResponseCode << Symbols::SPACE
146
StatusLine::errorContext() const
148
static const Data statLine("Status Line");
152
/* ====================================================================
153
* The Vovida Software License, Version 1.0
155
* Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
157
* Redistribution and use in source and binary forms, with or without
158
* modification, are permitted provided that the following conditions
161
* 1. Redistributions of source code must retain the above copyright
162
* notice, this list of conditions and the following disclaimer.
164
* 2. Redistributions in binary form must reproduce the above copyright
165
* notice, this list of conditions and the following disclaimer in
166
* the documentation and/or other materials provided with the
169
* 3. The names "VOCAL", "Vovida Open Communication Application Library",
170
* and "Vovida Open Communication Application Library (VOCAL)" must
171
* not be used to endorse or promote products derived from this
172
* software without prior written permission. For written
173
* permission, please contact vocal@vovida.org.
175
* 4. Products derived from this software may not be called "VOCAL", nor
176
* may "VOCAL" appear in their name, without prior written
177
* permission of Vovida Networks, Inc.
179
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
180
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
181
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
182
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
183
* NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
184
* IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
185
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
186
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
187
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
188
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
189
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
190
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
193
* ====================================================================
195
* This software consists of voluntary contributions made by Vovida
196
* Networks, Inc. and many individuals on behalf of Vovida Networks,
197
* Inc. For more information on Vovida Networks, Inc., please see
198
* <http://www.vovida.org/>.