Skip to content

Commit 1fe733f

Browse files
committed
Merge 'etr/master' into large_POST.
This removes the modification done in pellucide's branch to append in set_arg. That is instead done in webserver::post_iterator and webserver::finalize_answer. Conflicts: src/httpserver/http_request.hpp
2 parents d727939 + e396fe4 commit 1fe733f

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

src/httpserver/http_response.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class http_response
110110
* Method used to get the content from the response.
111111
* @return the content in string form
112112
**/
113-
const std::string get_content()
113+
std::string get_content()
114114
{
115115
return this->content;
116116
}
@@ -125,7 +125,7 @@ class http_response
125125
* @param key The header identification
126126
* @return a string representing the value assumed by the header
127127
**/
128-
const std::string get_header(const std::string& key)
128+
std::string get_header(const std::string& key)
129129
{
130130
return this->headers[key];
131131
}
@@ -140,7 +140,7 @@ class http_response
140140
* @param key The footer identification
141141
* @return a string representing the value assumed by the footer
142142
**/
143-
const std::string get_footer(const std::string& key)
143+
std::string get_footer(const std::string& key)
144144
{
145145
return this->footers[key];
146146
}
@@ -150,7 +150,7 @@ class http_response
150150
result = this->footers[key];
151151
}
152152

153-
const std::string get_cookie(const std::string& key)
153+
std::string get_cookie(const std::string& key)
154154
{
155155
return this->cookies[key];
156156
}
@@ -189,7 +189,7 @@ class http_response
189189
return this->response_code;
190190
}
191191

192-
const std::string get_realm() const
192+
std::string get_realm() const
193193
{
194194
return this->realm;
195195
}
@@ -199,7 +199,7 @@ class http_response
199199
result = this->realm;
200200
}
201201

202-
const std::string get_opaque() const
202+
std::string get_opaque() const
203203
{
204204
return this->opaque;
205205
}
@@ -209,7 +209,7 @@ class http_response
209209
result = this->opaque;
210210
}
211211

212-
const bool need_nonce_reload() const
212+
bool need_nonce_reload() const
213213
{
214214
return this->reload_nonce;
215215
}

src/httpserver/http_utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ struct ip_representation
303303
ip_representation(const struct sockaddr* ip);
304304

305305
bool operator <(const ip_representation& b) const;
306-
const int weight() const
306+
int weight() const
307307
{
308308
//variable-precision SWAR algorithm
309309
unsigned int x = mask;

src/httpserver/webserver.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,22 +145,22 @@ class webserver
145145
bool is_valid(const std::string& key);
146146
void clean_cache();
147147

148-
const log_access_ptr get_access_logger() const
148+
log_access_ptr get_access_logger() const
149149
{
150150
return this->log_access;
151151
}
152152

153-
const log_error_ptr get_error_logger() const
153+
log_error_ptr get_error_logger() const
154154
{
155155
return this->log_error;
156156
}
157157

158-
const validator_ptr get_request_validator() const
158+
validator_ptr get_request_validator() const
159159
{
160160
return this->validator;
161161
}
162162

163-
const unescaper_ptr get_unescaper() const
163+
unescaper_ptr get_unescaper() const
164164
{
165165
return this->unescaper;
166166
}

src/webserver.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,13 +671,19 @@ int webserver::bodyfull_requests_answer_first_step(
671671
encoding,
672672
strlen (MHD_HTTP_POST_ENCODING_FORM_URLENCODED)
673673
)
674-
))
674+
)
675+
|| (0 == strncasecmp (
676+
MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA,
677+
encoding,
678+
strlen (MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA)
679+
)))
675680
)
676681
)
677682
{
683+
const size_t post_memory_limit (32*1024); // Same as #MHD_POOL_SIZE_DEFAULT
678684
mr->pp = MHD_create_post_processor (
679685
connection,
680-
1024,
686+
post_memory_limit,
681687
&post_iterator,
682688
mr
683689
);

0 commit comments

Comments
 (0)