Ryo Iizuka / libMiMic

Dependents:   MbedFileServer_1768MiniDK2 RedWireBridge IssueDebug_gcc MiMicRemoteMCU-for-Mbed ... more

Revision:
63:157ee3202edb
Parent:
58:03b89038b21a
Child:
69:8c5f220441f5
--- a/core/uip/NyLPC_cTcpSocket.c	Thu Oct 03 04:53:11 2013 +0000
+++ b/core/uip/NyLPC_cTcpSocket.c	Fri Oct 18 12:40:09 2013 +0000
@@ -1238,8 +1238,6 @@
                 }
             }
         }
-//      //MSSとWNDの更新
-//      i_inst->uip_connr.peer_mss = i_inst->uip_connr.default_mss;//@bug じゃないのこれ。peer_mss勝手に上書きしたらダメだろ
         //どちらにしろ、ACK送信
         if(is_new_packet && (in_tcpflag & TCP_FIN)){
             //FINがあるときは、ステータスをCLOSE_WAITへセットして、ACKを返す。
@@ -1259,14 +1257,17 @@
         break;
     case UIP_FIN_WAIT_1:
         //FIN受信->CLOSINGへ
-        if(is_new_packet && (in_tcpflag & TCP_FIN)){
-            i_inst->uip_connr.rcv_nxt32++;
-            if(num_of_noack==0){
-                //FINとACKを受信
-                i_inst->tcpstateflags=UIP_TIME_WAIT;
-            }else{
-                //FINのみ
-                i_inst->tcpstateflags=UIP_CLOSING;
+        if(is_new_packet){
+            i_inst->uip_connr.rcv_nxt32+=data_size;
+            if(in_tcpflag & TCP_FIN){
+                i_inst->uip_connr.rcv_nxt32++;
+                if(num_of_noack==0){
+                    //FINとACKを受信
+                    i_inst->tcpstateflags=UIP_TIME_WAIT;
+                }else{
+                    //FINのみ
+                    i_inst->tcpstateflags=UIP_CLOSING;
+                }
             }
         }else if(num_of_noack==0){
             //ACKのみ