Вот есть две элементарных программы:Первая:
#include "fcgi_stdio.h"
#include <stdlib.h>
int main(void)
{
int count = 0;
while(FCGI_Accept() >= 0)
printf("Content-type: text/html\r\n"
"\r\n"
"<title>FastCGI Hello!</title>"
"<h1>FastCGI Hello!</h1>"
"Request number %d running on host <i>%s</i>\n",
++count, getenv("SERVER_NAME"));
return 0;
}
Компилируется, и адекватно работает.
И вторая:
#include "fcgi_stdio.h"
#include <stdlib.h>
#include "network.h"
int main(void)
{
Network nt;
int count = 0;
while(FCGI_Accept() >= 0)
printf("Content-type: text/html\r\n"
"\r\n"
"<title>FastCGI Hello!</title>"
"<h1>FastCGI Hello!</h1>"
"Request number %d running on host <i>%s</i>\n",
++count, getenv("SERVER_NAME"));
return 0;
}
Компилируется без сучка-без задоринки... А вот на выполнении пишет:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
А в логе:
FastCGI: incomplete headers (0 bytes) received from server "/home/.../cgi-bin/engine.fcgi"
При том что она не заканчивает сбоем программы, процесс остается в памяти, только почему-то не выдает того что должен был бы.
Про включенный файл network.h и сам класс Network - обычные классы, используют контейнеры STL. Нигде в этом классе не происходит ввода-вывода. Что это может быть?