mirror of
https://github.com/lxsang/antd-cgi-plugin
synced 2024-12-26 18:08:21 +01:00
update to the new lib
This commit is contained in:
parent
a84407344a
commit
c19517392d
28
cgi.c
28
cgi.c
@ -1,7 +1,12 @@
|
|||||||
#define PLUGIN_IMPLEMENT 1
|
#define PLUGIN_IMPLEMENT 1
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <antd/plugin.h>
|
#include <antd/plugin.h>
|
||||||
#include "antd/ini.h"
|
#include <antd/scheduler.h>
|
||||||
|
#include <antd/ini.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#define MAX_ENV_SIZE 100
|
#define MAX_ENV_SIZE 100
|
||||||
|
|
||||||
@ -342,21 +347,6 @@ void *handle(void *data)
|
|||||||
// send out the rest of data
|
// send out the rest of data
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
/*FD_ZERO(&rfd);
|
|
||||||
FD_SET(inpipefd[0], &rfd);
|
|
||||||
timeout.tv_sec = 0;
|
|
||||||
timeout.tv_usec = 500;
|
|
||||||
count = select(inpipefd[0]+1, &rfd, NULL, NULL, &timeout);
|
|
||||||
if(count == 0)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if(count == -1)
|
|
||||||
{
|
|
||||||
ERROR("select: %s", strerror(errno));
|
|
||||||
break;
|
|
||||||
}*/
|
|
||||||
// there is data comming
|
|
||||||
count = read(inpipefd[0], buf, BUFFLEN);
|
count = read(inpipefd[0], buf, BUFFLEN);
|
||||||
|
|
||||||
if (count == -1)
|
if (count == -1)
|
||||||
@ -382,11 +372,7 @@ void *handle(void *data)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int cnt = antd_send(cl, buf, count);
|
UNUSED(antd_send(cl, buf, count));
|
||||||
/*if(cnt != count)
|
|
||||||
{
|
|
||||||
ERROR("Cannot sent the entire data %d vs %d", cnt, count);
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user