mirror of
https://github.com/fumiama/simple-http-server.git
synced 2026-06-12 14:10:40 +08:00
完善cgi sendfile
This commit is contained in:
5
server.c
5
server.c
@@ -264,7 +264,8 @@ static void execute_cgi(int client, const char *path, const char *method, const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
uint32_t cnt = 0;
|
uint32_t cnt = 0;
|
||||||
read(cgi_output[0], (char*)&cnt, sizeof(uint32_t));
|
if(read(cgi_output[0], (char*)&cnt, sizeof(uint32_t)) > 0) {
|
||||||
|
printf("cgi msg cnt: %u bytes.\n", cnt);
|
||||||
if(cnt > 0) {
|
if(cnt > 0) {
|
||||||
int len = 0;
|
int len = 0;
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
@@ -274,7 +275,7 @@ static void execute_cgi(int client, const char *path, const char *method, const
|
|||||||
#endif
|
#endif
|
||||||
printf("cgi send %d bytes\n", len);
|
printf("cgi send %d bytes\n", len);
|
||||||
}
|
}
|
||||||
|
} else cannot_execute(client);
|
||||||
close(cgi_output[0]);
|
close(cgi_output[0]);
|
||||||
close(cgi_input[1]);
|
close(cgi_input[1]);
|
||||||
waitpid(pid, &status, 0);
|
waitpid(pid, &status, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user