Przeglądaj źródła

*** empty log message ***

David Rose 25 lat temu
rodzic
commit
cbf3460225

+ 6 - 1
panda/src/net/connection.cxx

@@ -136,7 +136,12 @@ send_datagram(const NetDatagram &datagram) {
   PR_Unlock(_write_mutex);
   PR_Unlock(_write_mutex);
 
 
   if (result < 0) {
   if (result < 0) {
-    if (errcode == PR_CONNECT_RESET_ERROR) {
+    if (errcode == PR_CONNECT_RESET_ERROR
+#ifdef PR_SOCKET_SHUTDOWN_ERROR
+	|| errcode == PR_SOCKET_SHUTDOWN_ERROR
+	|| errcode == PR_CONNECT_ABORTED_ERROR
+#endif
+	) {
       // The connection has been reset; tell our manager about it
       // The connection has been reset; tell our manager about it
       // and ignore it.
       // and ignore it.
       if (_manager != (ConnectionManager *)NULL) {
       if (_manager != (ConnectionManager *)NULL) {

+ 12 - 2
panda/src/net/connectionReader.cxx

@@ -504,7 +504,12 @@ process_incoming_tcp_data(SocketInfo *sinfo) {
 
 
     if (bytes_read < 0) {
     if (bytes_read < 0) {
       PRErrorCode errcode = PR_GetError();
       PRErrorCode errcode = PR_GetError();
-      if (errcode == PR_CONNECT_RESET_ERROR) {
+      if (errcode == PR_CONNECT_RESET_ERROR
+#ifdef PR_SOCKET_SHUTDOWN_ERROR
+	  || errcode == PR_SOCKET_SHUTDOWN_ERROR
+	  || errcode == PR_CONNECT_ABORTED_ERROR
+#endif
+	  ) {
 	// The socket was closed.
 	// The socket was closed.
 	if (_manager != (ConnectionManager *)NULL) {
 	if (_manager != (ConnectionManager *)NULL) {
 	  _manager->connection_reset(sinfo->_connection);
 	  _manager->connection_reset(sinfo->_connection);
@@ -557,7 +562,12 @@ process_incoming_tcp_data(SocketInfo *sinfo) {
     
     
     if (bytes_read < 0) {
     if (bytes_read < 0) {
       PRErrorCode errcode = PR_GetError();
       PRErrorCode errcode = PR_GetError();
-      if (errcode == PR_CONNECT_RESET_ERROR) {
+      if (errcode == PR_CONNECT_RESET_ERROR 
+#ifdef PR_SOCKET_SHUTDOWN_ERROR
+	  || errcode == PR_SOCKET_SHUTDOWN_ERROR
+	  || errcode == PR_CONNECT_ABORTED_ERROR
+#endif
+	  ) {
 	// The socket was closed.
 	// The socket was closed.
 	if (_manager != (ConnectionManager *)NULL) {
 	if (_manager != (ConnectionManager *)NULL) {
 	  _manager->connection_reset(sinfo->_connection);
 	  _manager->connection_reset(sinfo->_connection);