Browse Source

RPC: Explicitly shutdown communication on client sockets to avoid them being held open by forked processes

Luke Dashjr 11 years ago
parent
commit
1ac2181aed
1 changed files with 2 additions and 0 deletions
  1. 2 0
      api.c

+ 2 - 0
api.c

@@ -3826,6 +3826,7 @@ static void mcast()
 								replybuf, (int)rep, (int)reply_sock);
 				}
 
+				shutdown(reply_sock, SHUT_RDWR);
 				CLOSESOCKET(reply_sock);
 			}
 		} else
@@ -4109,6 +4110,7 @@ void api(int api_thr_id)
 				}
 			}
 		}
+		shutdown(c, SHUT_RDWR);
 		CLOSESOCKET(c);
 	}
 die: