Andrew Boyson / net

Dependents:   oldheating gps motorhome heating

Revision:
126:62edacc9f14d
Parent:
93:580fc113d9e9
Child:
131:774f7f367031
diff -r 8c84daac38ab -r 62edacc9f14d tcp/tcb.h
--- a/tcp/tcb.h	Fri Feb 22 11:26:55 2019 +0000
+++ b/tcp/tcb.h	Mon Feb 25 20:59:19 2019 +0000
@@ -28,12 +28,20 @@
     uint32_t bytesAckdToRem;
     bool     rcvdFin;
     
-     int32_t todo;
-    
     uint32_t locIsn;
     uint32_t bytesSentToRem;
     uint32_t bytesAckdByRem;
     bool     sentFin;
+    
+    /*
+    Communicates between application (HTTP) and TCP.
+    Application usually works out what to do from the first packet and so it stores that in todo to remember what it is doing for subsequent packets.
+    Once all packets have been received the application sets postCompleted to indicate that TCP should start sending data.
+    Once all packets have been sent the application returns a data size less than MSS.
+    Note that TCP needs to keep todo in case data has to be resent after the application thinks it has finished.
+    */
+     int32_t todo;
+     bool    postComplete;
 };
 
 extern uint32_t    TcbGetIsn(void);