代码拉取完成,页面将自动刷新
同步操作将从 zhouxiang/ccfast 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#ifndef FCGIWORKER_H
#define FCGIWORKER_H
#include "fcgiprogram.h"
#include "ObjectCreator.h"
#include "fcgi_stdio.h"
#include <string.h>
#include "response.h"
#include <sendemail.h>
#include "util.h"
template <typename T>
///
/// \brief The FcgiWorker class,to be a ane face
/// T1 FcgiProgram subclass
///
class FcgiWorker
{
public:
FcgiWorker();
~FcgiWorker() {}
void run();
private:
boost::shared_ptr<FcgiProgram> m_fcgi;
};
template <typename T>
FcgiWorker<T>::FcgiWorker()
{
m_fcgi = ObjectCreator<T>()();
}
template <typename T>
///
/// \brief FcgiWorker<T1, T2>::run
/// anything do in run
///
void FcgiWorker<T>::run()
{
do {
try
{
m_fcgi->init();
} catch(const std::exception& ex)
{
std::cerr << ex.what() << std::endl;
std::string _message = ex.what();
_message += "<br>hostname:";
_message += get_hostname();
SendEmail::send("Fcgi_init_error!", format_send_email(_message));
break;
}
while (FCGI_Accept() >= 0)
{
try
{
m_fcgi->process();
} catch(const std::exception& ex1)
{
//print to log
std::cerr << ex1.what() << std::endl;
std::string _message = ex1.what();
_message += "<br>hostname:";
_message += get_hostname();
SendEmail::send("Fcgi_runtime_error!", format_send_email(_message));
FCGI_puts(Response::json(CODE_SYSERR, MESSAGE_SYSERR, KVList()).c_str());
break;
}
}
m_fcgi->end();
}while(true);
}
#endif // FCGIWORKER_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。