소스 검색

Marking WRITE end of a pipe as closed in handle_cgi_request()

Sergey Lyubka 12 년 전
부모
커밋
614b219a27
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      mongoose.c

+ 2 - 0
mongoose.c

@@ -3133,9 +3133,11 @@ static void handle_cgi_request(struct mg_connection *conn, const char *prog) {
       !forward_body_data(conn, in, INVALID_SOCKET, NULL)) {
     goto done;
   }
+
   // Close so child gets an EOF.
   fclose(in);
   in = NULL;
+  fd_stdin[1] = -1;
 
   // Now read CGI reply into a buffer. We need to set correct
   // status code, thus we need to see all HTTP headers first.