fcgx_accept_r 返回-88 我的解法
来源:互联网 发布:小学生口算软件 编辑:程序博客网 时间:2024/05/03 09:38
这个问题谈不上解法.
现象描述:
我突然发现我写的nginx+ fcgi的一个demo不能达到我的预期效果了.然后我打印出fcgx_accept_r ()的返回值后发现时-88,网上这方面的资料比较少,-88 你也不知道具体发生了什么.目前通过fcgi的文档了解到fcgx_accept_r ()该函数正确情况下返回0或者一个正值,错误情况返回-1.
我纠结了两天,毕竟我之前都运行好好的.结果:重启了一下安装了nginx的虚拟机,我的问题神奇般的解决了.我所写的demo如下:
#include "fcgio.h"#include "fcgi_config.h"#include <unistd.h>#include <stdlib.h>using namespace std;int main(){ FCGX_Request request; int rc; if(FCGX_Init()==-1) { cout<<"Init error!"<<endl; return -1; } FCGX_InitRequest(&request,0,0); streambuf * cin_streambuf = cin.rdbuf(); streambuf * cout_streambuf = cout.rdbuf(); streambuf * cerr_streambuf = cerr.rdbuf(); while(1) { rc = FCGX_Accept_r(&request); if(rc<0) break; fcgi_streambuf cin_fcgi_streambuf(request.in); fcgi_streambuf cout_fcgi_streambuf(request.out); fcgi_streambuf cerr_fcgi_streambuf(request.err);#if HAVE_IOSTREAM_WITHASSIGN_STREAMBUF cin = &cin_fcgi_streambuf; cout = &cout_fcgi_streambuf; cerr = &cerr_fcgi_streambuf;#else cin.rdbuf(&cin_fcgi_streambuf); cout.rdbuf(&cout_fcgi_streambuf); cerr.rdbuf(&cerr_fcgi_streambuf);#endif char *query_string = FCGX_GetParam("QUERY_STRING", request.envp ); char *server_name = FCGX_GetParam("SERVER_NAME", request.envp); if(query_string) { cout << "Content-type: text/html\r\n" "\r\n" "<TITLE>FINCHINA INFO</TITLE>\n" "<H1>TEST</H1>\n" "<H4>QUERY_STRING:"<<query_string <<"</H4>\n" "<H4>SERVER_NAME:"<<server_name<<"</H4>\n"; } FCGX_Finish_r(&request); } return 0;}
希望有朋友遇到相同的问题的,在评论区一起讨论这个问题.
0 0
- fcgx_accept_r 返回-88 我的解法
- 我的螺旋矩阵解法!
- 编程作业-我的解法
- 一道面试题,我的解法
- 阿里实习生电面题 我的解法
- Divide Two Integers我的解法
- 463. Island Perimeter我的解法
- LeetCode500. Keyboard Row我的C++解法
- leetcode--Hamming Distance _我的解法
- 洛谷3987之我的解法
- nginx—fastcgi—FCGX_Accept_r failed with error code: -88—in CentOS7
- google的一道面试题!(附我的解法)
- 关于google的JAVA面试题我的解法
- 一个ITAT大赛的试题(我的解法)
- poj 2262题 我的解法很不错
- 凑个热闹:我的微软面试题解法
- POJ 1945 Power Hungry Cows 我的解法
- leetcode刷题,我的解法1 twosum问题
- 目标检测(Object Detection)原理与实现(六)
- 找到一个 准备笔试面试网站 牛客网
- BCC校验
- 伊斯坦布尔之旅第二站:从韩国到土耳其
- iohone屏幕适配及分辨率
- fcgx_accept_r 返回-88 我的解法
- 【android动态布局】之【ListView动态加载数据模板(使用xml布局)】
- 多线程之线程初始
- Neural Networks for Machine Learning by Geoffrey Hinton (4)
- Android ActionBar总结一
- 浅谈Spring事务隔离级别
- iPhone开发技巧之调试篇(3)— 程序Crash后的调试技巧
- 理解 Linux 的硬链接与软链接
- 匿名项目连载(五)--->发布说说