@@ -31,12 +31,12 @@ class response {
31
31
* lower-case the name but store the value as is
32
32
*/
33
33
inline void add_header (std::string name, std::string const & value);
34
- inline void append_body (const char * p , size_t sz );
34
+ inline void append_body (const char * payload , size_t payload_size );
35
35
inline bool has_header (char const * header) const ;
36
36
inline lambda_runtime::outcome<std::string, bool > get_header (char const * header) const ;
37
37
inline response_code get_response_code () const { return m_response_code; }
38
- inline void set_response_code (aws::http::response_code c );
39
- inline void set_content_type (char const * ct );
38
+ inline void set_response_code (aws::http::response_code code );
39
+ inline void set_content_type (char const * content );
40
40
inline std::string const & get_body () const ;
41
41
42
42
private:
@@ -125,14 +125,14 @@ enum class response_code {
125
125
NETWORK_CONNECT_TIMEOUT = 599
126
126
};
127
127
128
- inline void response::set_response_code (http::response_code c )
128
+ inline void response::set_response_code (http::response_code code )
129
129
{
130
- m_response_code = c ;
130
+ m_response_code = code ;
131
131
}
132
132
133
- inline void response::set_content_type (char const * ct )
133
+ inline void response::set_content_type (char const * content_type )
134
134
{
135
- m_content_type = ct ;
135
+ m_content_type = content_type ;
136
136
}
137
137
138
138
inline std::string const & response::get_body () const
@@ -145,34 +145,34 @@ inline void response::add_header(std::string name, std::string const& value)
145
145
m_headers.emplace_back (std::move (name), value);
146
146
}
147
147
148
- inline void response::append_body (const char * p , size_t sz )
148
+ inline void response::append_body (const char * payload , size_t payload_size )
149
149
{
150
150
// simple and generates significantly less code than std::stringstream
151
151
constexpr size_t min_capacity = 512 ;
152
152
if (m_body.capacity () < min_capacity) {
153
153
m_body.reserve (min_capacity);
154
154
}
155
155
156
- m_body.append (p, sz );
156
+ m_body.append (payload, payload_size );
157
157
}
158
158
159
159
inline bool response::has_header (char const * header) const
160
160
{
161
- return std::any_of (m_headers.begin (), m_headers.end (), [header](std::pair<std::string, std::string> const & p ) {
162
- return p .first == header;
161
+ return std::any_of (m_headers.begin (), m_headers.end (), [header](std::pair<std::string, std::string> const & item ) {
162
+ return item .first == header;
163
163
});
164
164
}
165
165
166
166
inline lambda_runtime::outcome<std::string, bool > response::get_header (char const * header) const
167
167
{
168
- auto it = std::find_if (m_headers.begin (), m_headers.end (), [header](std::pair<std::string, std::string> const & p ) {
169
- return p .first == header;
168
+ auto iter = std::find_if (m_headers.begin (), m_headers.end (), [header](std::pair<std::string, std::string> const & item ) {
169
+ return item .first == header;
170
170
});
171
171
172
- if (it == m_headers.end ()) {
172
+ if (iter == m_headers.end ()) {
173
173
return false ;
174
174
}
175
- return it ->second ;
175
+ return iter ->second ;
176
176
}
177
177
178
178
} // namespace http
0 commit comments