]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
Reverted invalid fix for invalid bug #34360 done yesterday...
authorSimon Goldschmidt <goldsimon@gmx.de>
Fri, 23 Sep 2011 17:26:29 +0000 (19:26 +0200)
committerSimon Goldschmidt <goldsimon@gmx.de>
Fri, 23 Sep 2011 17:26:29 +0000 (19:26 +0200)
CHANGELOG
src/core/tcp.c

index b5811da4dfad8bce63a16925b12a1fd5b4a53675..df44d8d4e1bd1f0f7ab5d7e0190e018c89c3ccf4 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -69,10 +69,6 @@ HISTORY
   * pbuf.h, tcp.c, tcp_in.c: fixed bug #33871: rejecting TCP_EVENT_RECV() for
     the last packet including FIN can lose data
 
-  2011-09-22: Simon Goldschmidt
-  * tcp.c: fixed bug #34360 tcp_shutdown: RST on unacked is not send when
-    shutting down both rx AND tx
-
   2011-09-22: Simon Goldschmidt
   * tcp_impl.h: fixed bug #34355: nagle does not take snd_buf/snd_queuelen into
     account
index cd94e7486d7c4a10fcf5d383a0bc9c4f5c8ee7a5..3a03ac1e921c87ca721b587b667df48e264a120e 100644 (file)
@@ -305,7 +305,12 @@ tcp_shutdown(struct tcp_pcb *pcb, int shut_rx, int shut_tx)
     return ERR_CONN;
   }
   if (shut_rx) {
-    /* shut down the receive side: set a flag not to receive any more data */
+    /* shut down the receive side: free buffered data... */
+    if (pcb->refused_data != NULL) {
+      pbuf_free(pcb->refused_data);
+      pcb->refused_data = NULL;
+    }
+    /* ... and set a flag not to receive any more data */
     pcb->flags |= TF_RXCLOSED;
   }
   if (shut_tx) {
@@ -315,18 +320,12 @@ tcp_shutdown(struct tcp_pcb *pcb, int shut_rx, int shut_tx)
   case SYN_RCVD:
   case ESTABLISHED:
   case CLOSE_WAIT:
-    /* if shut_tx AND shut_rx, send RST if we have unacked data */
-    return tcp_close_shutdown(pcb, (u8_t)shut_rx);
+    return tcp_close_shutdown(pcb, 0);
   default:
     /* don't shut down other states */
     break;
     }
   }
-  if (shut_rx && (pcb->refused_data != NULL)) {
-    /* shut down the receive side: free buffered data if we come here */
-    pbuf_free(pcb->refused_data);
-    pcb->refused_data = NULL;
-  }
   /* @todo: return another err_t if not in correct state or already shut? */
   return ERR_OK;
 }