1
0
mirror of https://github.com/fumiama/simple-http-server.git synced 2026-06-06 01:00:23 +08:00

低速特判

This commit is contained in:
源文雨
2021-06-08 16:53:55 +08:00
parent 6b49b0ca04
commit 6149427448

View File

@@ -284,7 +284,15 @@ static void execute_cgi(int client, const char *path, const char *method, const
}
if(data) free(data);
#else
len = splice(cgi_output[0], NULL, client, NULL, cnt, SPLICE_F_GIFT);
while(len < cnt) {
int delta = splice(cgi_output[0], NULL, client, NULL, cnt - len, SPLICE_F_GIFT);
if(delta < 0) {
cannot_execute(client);
break;
}
len += delta;
}
#endif
printf("cgi send %d bytes\n", len);
}