@@ -76,6 +76,7 @@ class http_response
7676 const std::string& content = " " ,
7777 int response_code = 200 ,
7878 const std::string& content_type = " text/plain" ,
79+ bool autodelete = true ,
7980 const std::string& realm = " " ,
8081 const std::string& opaque = " " ,
8182 bool reload_nonce = false ,
@@ -87,6 +88,7 @@ class http_response
8788 response_type (response_type),
8889 content (content),
8990 response_code (response_code),
91+ autodelete (autodelete),
9092 realm (realm),
9193 opaque (opaque),
9294 reload_nonce (reload_nonce),
@@ -107,6 +109,7 @@ class http_response
107109 response_type (b.response_type),
108110 content (b.content),
109111 response_code (b.response_code),
112+ autodelete (b.autodelete),
110113 realm (b.realm),
111114 opaque (b.opaque),
112115 reload_nonce (b.reload_nonce),
@@ -299,6 +302,7 @@ class http_response
299302 response_type_T response_type;
300303 std::string content;
301304 int response_code;
305+ bool autodelete;
302306 std::string realm;
303307 std::string opaque;
304308 bool reload_nonce;
@@ -325,8 +329,9 @@ class http_string_response : public http_response
325329 (
326330 const std::string& content,
327331 int response_code,
328- const std::string& content_type = " text/plain"
329- ): http_response(http_response::STRING_CONTENT, content, response_code, content_type) { }
332+ const std::string& content_type = " text/plain" ,
333+ bool autodelete = true
334+ ): http_response(http_response::STRING_CONTENT, content, response_code, content_type, autodelete) { }
330335
331336 http_string_response (const http_response& b) : http_response(b) { }
332337};
@@ -339,8 +344,9 @@ class http_byte_response : public http_response
339344 const char * content,
340345 size_t content_length,
341346 int response_code,
342- const std::string& content_type = " text/plain"
343- ): http_response(http_response::STRING_CONTENT, std::string(content, content_length), response_code, content_type) { }
347+ const std::string& content_type = " text/plain" ,
348+ bool autodelete = true
349+ ): http_response(http_response::STRING_CONTENT, std::string(content, content_length), response_code, content_type, autodelete) { }
344350};
345351
346352class http_file_response : public http_response
@@ -350,8 +356,9 @@ class http_file_response : public http_response
350356 (
351357 const std::string& filename,
352358 int response_code,
353- const std::string& content_type = " text/plain"
354- ) : http_response(http_response::FILE_CONTENT, filename, response_code, content_type)
359+ const std::string& content_type = " text/plain" ,
360+ bool autodelete = true
361+ ) : http_response(http_response::FILE_CONTENT, filename, response_code, content_type, autodelete)
355362 {
356363 }
357364
@@ -368,9 +375,10 @@ class http_basic_auth_fail_response : public http_response
368375 const std::string& content,
369376 int response_code,
370377 const std::string& content_type = " text/plain" ,
378+ bool autodelete = true ,
371379 const std::string& realm = " " ,
372380 const http_response::response_type_T& response_type = http_response::BASIC_AUTH_FAIL
373- ) : http_response(http_response::BASIC_AUTH_FAIL, content, response_code, content_type, realm) { }
381+ ) : http_response(http_response::BASIC_AUTH_FAIL, content, response_code, content_type, autodelete, realm) { }
374382
375383 http_basic_auth_fail_response (const http_response& b) : http_response(b) { }
376384};
@@ -383,10 +391,11 @@ class http_digest_auth_fail_response : public http_response
383391 const std::string& content,
384392 int response_code,
385393 const std::string& content_type = " text/plain" ,
394+ bool autodelete = true ,
386395 const std::string& realm = " " ,
387396 const std::string& opaque = " " ,
388397 bool reload_nonce = false
389- ) : http_response(http_response::DIGEST_AUTH_FAIL, content, response_code, content_type, realm, opaque, reload_nonce)
398+ ) : http_response(http_response::DIGEST_AUTH_FAIL, content, response_code, content_type, autodelete, realm, opaque, reload_nonce)
390399 {
391400 }
392401
@@ -400,7 +409,8 @@ class shoutCAST_response : public http_response
400409 (
401410 const std::string& content,
402411 int response_code,
403- const std::string& content_type = " text/plain"
412+ const std::string& content_type = " text/plain" ,
413+ bool autodelete = true
404414 );
405415
406416 shoutCAST_response (const http_response& b) : http_response(b) { }
@@ -431,9 +441,10 @@ class long_polling_receive_response : public http_response
431441 int response_code,
432442 const std::string& content_type,
433443 const std::vector<std::string>& topics,
444+ bool autodelete = true ,
434445 int keepalive_secs = -1 ,
435446 std::string keepalive_msg = " "
436- ) : http_response(http_response::LONG_POLLING_RECEIVE, content, response_code, content_type, " " , " " , false , topics, keepalive_secs, keepalive_msg)
447+ ) : http_response(http_response::LONG_POLLING_RECEIVE, content, response_code, content_type, autodelete, " " , " " , false , topics, keepalive_secs, keepalive_msg)
437448 {
438449 }
439450
@@ -453,8 +464,9 @@ class long_polling_send_response : public http_response
453464 long_polling_send_response
454465 (
455466 const std::string& content,
456- const std::string& topic
457- ) : http_response(http_response::LONG_POLLING_SEND, content, 200 , " " , " " , " " , false , std::vector<std::string>(), -1 , " " , topic)
467+ const std::string& topic,
468+ bool autodelete = true
469+ ) : http_response(http_response::LONG_POLLING_SEND, content, 200 , " " , autodelete, " " , " " , false , std::vector<std::string>(), -1 , " " , topic)
458470 {
459471 }
460472
0 commit comments