#include <fcgi_stdio.h>
int main( int argc, char *argv[] )
{
int counter = 0;
FILE *fp;
char buffer[20];
while( FCGI_Accept() >= 0 ) {
counter = counter + 1;
printf( "Content-Type: text/plain\n\n" );
printf( "%d",counter );
if (counter >= 100){
sprintf(buffer, "%d", counter);
fp =fopen("/tmp/counter.txt","a");
fputs(buffer, fp);
fputs("\n", fp);
fclose(fp);
counter = 0;
}
}
return 0;
}
C的FastCGI计数器
最新推荐文章于 2022-10-04 15:17:02 发布