Lab2_web / Mbed 2 deprecated webserverBlinky

Dependencies:   mbed

Fork of webserverBlinky by RealTimeCompLab2

Files at this revision

API Documentation at this revision

Comitter:
nixnax
Date:
Sun Aug 06 17:39:22 2017 +0000
Parent:
115:b8ddff0e782f
Child:
117:c819ae068336
Commit message:
Add FIN flag to FIN ACK response.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sun Aug 06 10:42:20 2017 +0000
+++ b/main.cpp	Sun Aug 06 17:39:22 2017 +0000
@@ -705,13 +705,12 @@
                 dataLen = tcpResponse(tcpDataOut,tcpDataSize); // not a web request, send a packet reporting number of received bytes
             }
             break;
+        case TCP_FLAG_FIN:
+        case TCP_FLAG_FIN | TCP_FLAG_ACK:
         case TCP_FLAG_FIN | TCP_FLAG_PSH | TCP_FLAG_ACK:
-        case TCP_FLAG_FIN | TCP_FLAG_ACK:
+            flagsOut = TCP_FLAG_ACK | TCP_FLAG_FIN; // set the FIN flag to start closing the connection
             ack_out++; // for FIN flag we always have to increase sequence by 1
             break;
-        case TCP_FLAG_FIN:
-            flagsOut = TCP_FLAG_ACK | TCP_FLAG_FIN; // set the FIN flag to start closing the connection
-            break;
         default:
             return; // ignore remaining packets
     } // switch