void BaseExecutionContext::onShutdownPreSend() {
  if (!m_shutdowns.isNull() && m_shutdowns.exists(ShutDown)) {
    executeFunctions(m_shutdowns[ShutDown]);
    m_shutdowns.remove(ShutDown);
  }
  obFlushAll(); // in case obStart was called without obFlush
}
Example #2
0
ExecutionContext::~ExecutionContext() {
  obFlushAll();
  for (list<OutputBuffer*>::const_iterator iter = m_buffers.begin();
       iter != m_buffers.end(); ++iter) {
    delete *iter;
  }
}
Example #3
0
void ExecutionContext::onShutdownPreSend() {
  Array &funcs = s_request_data->data->shutdowns;
  if (!funcs.isNull() && funcs.exists(ShutDown)) {
    executeFunctions(funcs[ShutDown]);
    funcs.remove(ShutDown);
  }
  obFlushAll(); // in case obStart was called without obFlush
}
Example #4
0
bool HHVM_FUNCTION(fastcgi_finish_request) {
  auto context = g_context.getNoCheck();
  auto transport = context->getTransport();
  context->obFlushAll();
  String content = context->obDetachContents();
  transport->sendRaw((void*)content.data(), content.size());
  transport->onSendEnd();
  return true;
}