Browse Source

Moved intrusive_ptr to internal location to prevent an attempt of instanciation by suncc

master
Artyom Beilis 8 years ago
parent
commit
3fa8ded0bf
2 changed files with 5 additions and 9 deletions
  1. +0
    -1
      private/cgi_api.h
  2. +5
    -8
      src/cgi_api.cpp

+ 0
- 1
private/cgi_api.h View File

@@ -168,7 +168,6 @@ namespace cgi {
void handle_eof(callback const &on_eof);
void handle_http_error(int code,http::context *context,ehandler const &h);
void handle_http_error_eof(booster::system::error_code const &e,int code,ehandler const &h);
booster::intrusive_ptr<connection::async_write_binder> get_write_binder(ehandler const &h,bool complete_response);

std::vector<char> content_;
cppcms::service *service_;


+ 5
- 8
src/cgi_api.cpp View File

@@ -448,8 +448,11 @@ struct connection::async_write_binder : public booster::callable<void(booster::s
}
};

booster::intrusive_ptr<connection::async_write_binder> connection::get_write_binder(ehandler const &h,bool complete_response)
void connection::async_write_response( http::response &response,
bool complete_response,
ehandler const &h)
{
// prepare cached binder
booster::intrusive_ptr<connection::async_write_binder> tmp;
if(cached_async_write_binder_) {
tmp.swap(cached_async_write_binder_);
@@ -460,14 +463,8 @@ booster::intrusive_ptr<connection::async_write_binder> connection::get_write_bin
tmp->conn = self();
tmp->h = h;
tmp->complete_response = complete_response;
return tmp;
}
// ready

void connection::async_write_response( http::response &response,
bool complete_response,
ehandler const &h)
{
booster::intrusive_ptr<async_write_binder> tmp = get_write_binder(h,complete_response);
booster::system::error_code e;
if(response.flush_async_chunk(e)!=0 || !has_pending()) {
get_io_service().post(tmp,e);


Loading…
Cancel
Save