Coverage Report

Created: 2025-11-05 06:27

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/resiprocate/resip/stack/OctetContents.cxx
Line
Count
Source
1
#if defined(HAVE_CONFIG_H)
2
#include "config.h"
3
#endif
4
5
#include "resip/stack/OctetContents.hxx"
6
#include "resip/stack/SipMessage.hxx"
7
#include "rutil/Logger.hxx"
8
#include "rutil/ParseBuffer.hxx"
9
#include "rutil/WinLeakCheck.hxx"
10
11
12
using namespace resip;
13
using namespace std;
14
15
#define RESIPROCATE_SUBSYSTEM Subsystem::SIP
16
17
const OctetContents OctetContents::Empty;
18
19
bool
20
OctetContents::init()
21
8
{
22
8
   static ContentsFactory<OctetContents> factory;
23
8
   (void)factory;
24
8
   return true;
25
8
}
26
27
OctetContents::OctetContents()
28
2
   : Contents(getStaticType()),
29
2
     mOctets()
30
2
{}
31
32
OctetContents::OctetContents(const Data& octets)
33
0
   : Contents(getStaticType()),
34
0
     mOctets(octets)
35
0
{}
36
37
OctetContents::OctetContents(const HeaderFieldValue& hfv, const Mime& contentsType)
38
6.07k
   : Contents(hfv, contentsType),
39
6.07k
     mOctets()
40
6.07k
{
41
6.07k
}
42
 
43
OctetContents::OctetContents(const Data& octets, const Mime& contentsType)
44
0
   : Contents(contentsType),
45
0
     mOctets(octets)
46
0
{
47
0
}
48
49
OctetContents::OctetContents(const OctetContents& rhs)
50
0
   : Contents(rhs),
51
0
     mOctets(rhs.mOctets)
52
0
{
53
0
}
54
55
OctetContents::~OctetContents()
56
6.07k
{
57
6.07k
}
58
59
OctetContents&
60
OctetContents::operator=(const OctetContents& rhs)
61
0
{
62
0
   if (this != &rhs)
63
0
   {
64
0
      Contents::operator=(rhs);
65
0
      mOctets = rhs.mOctets;
66
0
   }
67
0
   return *this;
68
0
}
69
70
Contents* 
71
OctetContents::clone() const
72
0
{
73
0
   return new OctetContents(*this);
74
0
}
75
76
const Mime& 
77
OctetContents::getStaticType() 
78
4
{
79
4
   static Mime type("application","octet-stream");
80
4
   return type;
81
4
}
82
83
EncodeStream& 
84
OctetContents::encodeParsed(EncodeStream& str) const
85
0
{
86
   //DebugLog(<< "OctetContents::encodeParsed " << mOctets);
87
0
   str << mOctets;
88
0
   return str;
89
0
}
90
91
void 
92
OctetContents::parse(ParseBuffer& pb)
93
6.07k
{
94
   //DebugLog(<< "OctetContents::parse: " << pb.position());
95
96
6.07k
   const char* anchor = pb.position();
97
6.07k
   pb.skipToEnd();
98
6.07k
   pb.data(mOctets, anchor);
99
100
   //DebugLog("OctetContents::parsed <" << mOctets << ">" );
101
6.07k
}
102
103
104
/* ====================================================================
105
 * The Vovida Software License, Version 1.0 
106
 * 
107
 * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
108
 * 
109
 * Redistribution and use in source and binary forms, with or without
110
 * modification, are permitted provided that the following conditions
111
 * are met:
112
 * 
113
 * 1. Redistributions of source code must retain the above copyright
114
 *    notice, this list of conditions and the following disclaimer.
115
 * 
116
 * 2. Redistributions in binary form must reproduce the above copyright
117
 *    notice, this list of conditions and the following disclaimer in
118
 *    the documentation and/or other materials provided with the
119
 *    distribution.
120
 * 
121
 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
122
 *    and "Vovida Open Communication Application Library (VOCAL)" must
123
 *    not be used to endorse or promote products derived from this
124
 *    software without prior written permission. For written
125
 *    permission, please contact vocal@vovida.org.
126
 *
127
 * 4. Products derived from this software may not be called "VOCAL", nor
128
 *    may "VOCAL" appear in their name, without prior written
129
 *    permission of Vovida Networks, Inc.
130
 * 
131
 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
132
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
133
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
134
 * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
135
 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
136
 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
137
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
138
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
139
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
140
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
141
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
142
 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
143
 * DAMAGE.
144
 * 
145
 * ====================================================================
146
 * 
147
 * This software consists of voluntary contributions made by Vovida
148
 * Networks, Inc. and many individuals on behalf of Vovida Networks,
149
 * Inc.  For more information on Vovida Networks, Inc., please see
150
 * <http://www.vovida.org/>.
151
 *
152
 */