Skip to content

Properly read any remaining data when closing FastCGI socket #1745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions main/fastcgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,11 +1287,11 @@ void fcgi_close(fcgi_request *req, int force, int destroy)
}
#else
if (!force) {
fcgi_header buf;
char buf[8];

shutdown(req->fd, 1);
/* read the last FCGI_STDIN header (it may be omitted) */
recv(req->fd, (char *)(&buf), sizeof(buf), 0);
/* read any remaining data, it may be omitted */
while (recv(req->fd, buf, sizeof(buf), 0) > 0) {}
}
close(req->fd);
#endif
Expand Down