Revision: 17186
          http://sourceforge.net/p/edk2/code/17186
Author:   sfu5
Date:     2015-04-17 02:25:05 +0000 (Fri, 17 Apr 2015)
Log Message:
-----------
Fix some grammar and converge formatting of the two versions of TcpInput.c

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: BALATON Zoltan <[email protected]>
Reviewed-by: Fu Siyuan <[email protected]>
Reviewed-by: Ye Ting <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c
    trunk/edk2/NetworkPkg/TcpDxe/TcpInput.c

Modified: trunk/edk2/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c       
2015-04-16 06:50:38 UTC (rev 17185)
+++ trunk/edk2/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c       
2015-04-17 02:25:05 UTC (rev 17186)
@@ -1,7 +1,7 @@
 /** @file
   TCP input process routines.
 
-Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -61,7 +61,7 @@
     //
     // Step 1A: Invoking fast retransmission.
     //
-    FlightSize = TCP_SUB_SEQ (Tcb->SndNxt, Tcb->SndUna);
+    FlightSize        = TCP_SUB_SEQ (Tcb->SndNxt, Tcb->SndUna);
 
     Tcb->Ssthresh     = MAX (FlightSize >> 1, (UINT32) (2 * Tcb->SndMss));
     Tcb->Recover      = Tcb->SndNxt;
@@ -109,7 +109,7 @@
       // Step 5 - Full ACK:
       // deflate the congestion window, and exit fast recovery
       //
-      FlightSize = TCP_SUB_SEQ (Tcb->SndNxt, Tcb->SndUna);
+      FlightSize        = TCP_SUB_SEQ (Tcb->SndNxt, Tcb->SndUna);
 
       Tcb->CWnd         = MIN (Tcb->Ssthresh, FlightSize + Tcb->SndMss);
 
@@ -556,15 +556,15 @@
   if (IsListEmpty (Head)) {
 
     InsertTailList (Head, &Nbuf->List);
-    return ;
+    return;
   }
 
   //
   // Find the point to insert the buffer
   //
   for (Prev = Head, Cur = Head->ForwardLink;
-      Cur != Head;
-      Prev = Cur, Cur = Cur->ForwardLink) {
+       Cur != Head;
+       Prev = Cur, Cur = Cur->ForwardLink) {
 
     Node = NET_LIST_USER_STRUCT (Cur, NET_BUF, List);
 
@@ -585,7 +585,7 @@
       if (TCP_SEQ_LEQ (Seg->End, TCPSEG_NETBUF (Node)->End)) {
 
         NetbufFree (Nbuf);
-        return ;
+        return;
       }
 
       TcpTrimSegment (Nbuf, TCPSEG_NETBUF (Node)->End, Seg->End);
@@ -737,7 +737,7 @@
           );
 
   if ((Tcb == NULL) || (Tcb->State == TCP_CLOSED)) {
-    DEBUG ((EFI_D_INFO, "TcpInput: send reset because no TCB find\n"));
+    DEBUG ((EFI_D_INFO, "TcpInput: send reset because no TCB found\n"));
 
     Tcb = NULL;
     goto SEND_RESET;
@@ -751,7 +751,7 @@
   //
   if (TcpParseOption (Nbuf->Tcp, &Option) == -1) {
     DEBUG ((EFI_D_ERROR, "TcpInput: reset the peer because"
-      " of mal-format option for Tcb %p\n", Tcb));
+      " of malformed option for TCB %p\n", Tcb));
 
     goto SEND_RESET;
   }
@@ -799,7 +799,7 @@
       Tcb     = TcpCloneTcb (Parent);
       if (Tcb == NULL) {
         DEBUG ((EFI_D_ERROR, "TcpInput: discard a segment because"
-          " failed to clone a child for TCB%x\n", Tcb));
+          " failed to clone a child for TCB %p\n", Tcb));
 
         goto DISCARD;
       }
@@ -865,7 +865,7 @@
     //
 
     //
-    // Fourth step: Check SYN. Pay attention to sitimulatous open
+    // Fourth step: Check SYN. Pay attention to simultaneous open
     //
     if (TCP_FLG_ON (Seg->Flag, TCP_FLG_SYN)) {
 
@@ -902,7 +902,7 @@
         goto StepSix;
       } else {
         //
-        // Received a SYN segment without ACK, simultanous open.
+        // Received a SYN segment without ACK, simultaneous open.
         //
         TcpSetState (Tcb, TCP_SYN_RCVD);
 
@@ -911,7 +911,7 @@
 
         TcpTrimInWnd (Tcb, Nbuf);
 
-        DEBUG ((EFI_D_WARN, "TcpInput: simultanous open "
+        DEBUG ((EFI_D_WARN, "TcpInput: simultaneous open "
           "for TCB %p in SYN_SENT\n", Tcb));
 
         goto StepSix;
@@ -1290,7 +1290,8 @@
   TcpSetKeepaliveTimer (Tcb);
 
   if (TCP_FLG_ON (Seg->Flag, TCP_FLG_URG) &&
-      !TCP_FIN_RCVD (Tcb->State)) {
+      !TCP_FIN_RCVD (Tcb->State)) 
+  {
 
     DEBUG ((EFI_D_INFO, "TcpInput: received urgent data "
       "from peer for connected TCB %p\n", Tcb));

Modified: trunk/edk2/NetworkPkg/TcpDxe/TcpInput.c
===================================================================
--- trunk/edk2/NetworkPkg/TcpDxe/TcpInput.c     2015-04-16 06:50:38 UTC (rev 
17185)
+++ trunk/edk2/NetworkPkg/TcpDxe/TcpInput.c     2015-04-17 02:25:05 UTC (rev 
17186)
@@ -1,7 +1,7 @@
 /** @file
   TCP input process routines.
 
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -531,8 +531,8 @@
       Urgent = 0;
 
       if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_RCVD_URG) &&
-          TCP_SEQ_LEQ (Seg->Seq, Tcb->RcvUp)
-          ) {
+          TCP_SEQ_LEQ (Seg->Seq, Tcb->RcvUp))
+      {
 
         if (TCP_SEQ_LEQ (Seg->End, Tcb->RcvUp)) {
           Urgent = Nbuf->TotalSize;
@@ -596,8 +596,7 @@
   //
   for (Prev = Head, Cur = Head->ForwardLink;
        Cur != Head;
-       Prev = Cur, Cur = Cur->ForwardLink
-       ) {
+       Prev = Cur, Cur = Cur->ForwardLink) {
 
     Node = NET_LIST_USER_STRUCT (Cur, NET_BUF, List);
 
@@ -753,7 +752,7 @@
 
   if ((Head->HeadLen < 5) || (Len < 0)) {
 
-    DEBUG ((EFI_D_INFO, "TcpInput: received an mal-formated packet\n"));
+    DEBUG ((EFI_D_INFO, "TcpInput: received a malformed packet\n"));
     goto DISCARD;
   }
 
@@ -788,7 +787,7 @@
           );
 
   if ((Tcb == NULL) || (Tcb->State == TCP_CLOSED)) {
-    DEBUG ((EFI_D_INFO, "TcpInput: send reset because no TCB find\n"));
+    DEBUG ((EFI_D_INFO, "TcpInput: send reset because no TCB found\n"));
 
     Tcb = NULL;
     goto SEND_RESET;
@@ -803,7 +802,7 @@
   if (TcpParseOption (Nbuf->Tcp, &Option) == -1) {
     DEBUG (
       (EFI_D_ERROR,
-      "TcpInput: reset the peer because of mal-format option for Tcb %p\n",
+      "TcpInput: reset the peer because of malformed option for TCB %p\n",
       Tcb)
       );
 
@@ -860,7 +859,7 @@
       if (Tcb == NULL) {
         DEBUG (
           (EFI_D_ERROR,
-          "TcpInput: discard a segment because failed to clone a child for 
TCB%p\n",
+          "TcpInput: discard a segment because failed to clone a child for TCB 
%p\n",
           Tcb)
           );
 
@@ -940,7 +939,7 @@
     //
 
     //
-    // Fourth step: Check SYN. Pay attention to sitimulatous open
+    // Fourth step: Check SYN. Pay attention to simultaneous open
     //
     if (TCP_FLG_ON (Seg->Flag, TCP_FLG_SYN)) {
 
@@ -961,8 +960,8 @@
         TcpDeliverData (Tcb);
 
         if ((Tcb->CongestState == TCP_CONGEST_OPEN) &&
-            TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_RTT_ON)
-            ) {
+            TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_RTT_ON))
+        {
 
           TcpComputeRtt (Tcb, Tcb->RttMeasure);
           TCP_CLEAR_FLG (Tcb->CtrlFlag, TCP_CTRL_RTT_ON);
@@ -992,7 +991,7 @@
 
         DEBUG (
           (EFI_D_WARN,
-          "TcpInput: simultanous open for TCB %p in SYN_SENT\n",
+          "TcpInput: simultaneous open for TCB %p in SYN_SENT\n",
           Tcb)
           );
 
@@ -1034,8 +1033,8 @@
 
   if ((TCP_SEQ_LT (Seg->Seq, Tcb->RcvWl2)) &&
       (Tcb->RcvWl2 == Seg->End) &&
-      !TCP_FLG_ON (Seg->Flag, TCP_FLG_SYN | TCP_FLG_FIN)
-        ) {
+      !TCP_FLG_ON (Seg->Flag, TCP_FLG_SYN | TCP_FLG_FIN))
+  {
 
     TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_ACK_NOW);
   }
@@ -1058,10 +1057,10 @@
       // if it comes from a LISTEN TCB.
       //
     } else if ((Tcb->State == TCP_ESTABLISHED) ||
-             (Tcb->State == TCP_FIN_WAIT_1) ||
-             (Tcb->State == TCP_FIN_WAIT_2) ||
-             (Tcb->State == TCP_CLOSE_WAIT)
-            ) {
+               (Tcb->State == TCP_FIN_WAIT_1) ||
+               (Tcb->State == TCP_FIN_WAIT_2) ||
+               (Tcb->State == TCP_CLOSE_WAIT))
+    {
 
       SOCK_ERROR (Tcb->Sk, EFI_CONNECTION_RESET);
 
@@ -1114,7 +1113,9 @@
 
   if (Tcb->State == TCP_SYN_RCVD) {
 
-    if (TCP_SEQ_LT (Tcb->SndUna, Seg->Ack) && TCP_SEQ_LEQ (Seg->Ack, 
Tcb->SndNxt)) {
+    if (TCP_SEQ_LT (Tcb->SndUna, Seg->Ack) &&
+        TCP_SEQ_LEQ (Seg->Ack, Tcb->SndNxt))
+    {
 
       Tcb->SndWnd     = Seg->Wnd;
       Tcb->SndWndMax  = MAX (Tcb->SndWnd, Tcb->SndWndMax);
@@ -1127,7 +1128,7 @@
 
       DEBUG (
         (EFI_D_INFO,
-        "TcpInput: connection established  for TCB %p in SYN_RCVD\n",
+        "TcpInput: connection established for TCB %p in SYN_RCVD\n",
         Tcb)
         );
 
@@ -1176,7 +1177,9 @@
     // RcvWl2 equals to the variable "LastAckSent"
     // defined there.
     //
-    if (TCP_SEQ_LEQ (Seg->Seq, Tcb->RcvWl2) && TCP_SEQ_LT (Tcb->RcvWl2, 
Seg->End)) {
+    if (TCP_SEQ_LEQ (Seg->Seq, Tcb->RcvWl2) &&
+        TCP_SEQ_LT (Tcb->RcvWl2, Seg->End))
+    {
 
       Tcb->TsRecent     = Option.TSVal;
       Tcb->TsRecentAge  = mTcpTick;
@@ -1206,8 +1209,8 @@
   if ((Seg->Ack == Tcb->SndUna) &&
       (Tcb->SndUna != Tcb->SndNxt) &&
       (Seg->Wnd == Tcb->SndWnd) &&
-      (0 == Len)
-      ) {
+      (0 == Len))
+  {
 
     Tcb->DupAck++;
   } else {
@@ -1219,8 +1222,8 @@
   // Congestion avoidance, fast recovery and fast retransmission.
   //
   if (((Tcb->CongestState == TCP_CONGEST_OPEN) && (Tcb->DupAck < 3)) ||
-      (Tcb->CongestState == TCP_CONGEST_LOSS)
-      ) {
+      (Tcb->CongestState == TCP_CONGEST_LOSS))
+  {
 
     if (TCP_SEQ_GT (Seg->Ack, Tcb->SndUna)) {
 
@@ -1249,8 +1252,8 @@
     Tcb->SndUna = Seg->Ack;
 
     if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_SND_URG) &&
-        TCP_SEQ_LT (Tcb->SndUp, Seg->Ack)
-        ) {
+        TCP_SEQ_LT (Tcb->SndUp, Seg->Ack))
+    {
 
       TCP_CLEAR_FLG (Tcb->CtrlFlag, TCP_CTRL_SND_URG);
     }
@@ -1260,8 +1263,8 @@
   // Update window info
   //
   if (TCP_SEQ_LT (Tcb->SndWl1, Seg->Seq) ||
-      ((Tcb->SndWl1 == Seg->Seq) && TCP_SEQ_LEQ (Tcb->SndWl2, Seg->Ack))
-      ) {
+      ((Tcb->SndWl1 == Seg->Seq) && TCP_SEQ_LEQ (Tcb->SndWl2, Seg->Ack)))
+  {
 
     Right = Seg->Ack + Seg->Wnd;
 
@@ -1269,8 +1272,8 @@
 
       if ((Tcb->SndWl1 == Seg->Seq) &&
           (Tcb->SndWl2 == Seg->Ack) &&
-          (Len == 0)
-          ) {
+          (Len == 0))
+      {
 
         goto NO_UPDATE;
       }
@@ -1281,12 +1284,16 @@
         Tcb)
         );
 
-      if ((Tcb->CongestState == TCP_CONGEST_RECOVER) && (TCP_SEQ_LT (Right, 
Tcb->Recover))) {
+      if ((Tcb->CongestState == TCP_CONGEST_RECOVER) &&
+          (TCP_SEQ_LT (Right, Tcb->Recover)))
+      {
 
         Tcb->Recover = Right;
       }
 
-      if ((Tcb->CongestState == TCP_CONGEST_LOSS) && (TCP_SEQ_LT (Right, 
Tcb->LossRecover))) {
+      if ((Tcb->CongestState == TCP_CONGEST_LOSS) &&
+          (TCP_SEQ_LT (Right, Tcb->LossRecover)))
+      {
 
         Tcb->LossRecover = Right;
       }
@@ -1311,7 +1318,9 @@
 
 NO_UPDATE:
 
-  if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_FIN_SENT) && (Tcb->SndUna == 
Tcb->SndNxt)) {
+  if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_FIN_SENT) &&
+      (Tcb->SndUna == Tcb->SndNxt))
+  {
 
     DEBUG (
       (EFI_D_INFO,
@@ -1417,7 +1426,9 @@
 
     Urg = Seg->Seq + Seg->Urg;
 
-    if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_RCVD_URG) && TCP_SEQ_GT (Urg, 
Tcb->RcvUp)) {
+    if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_RCVD_URG) &&
+        TCP_SEQ_GT (Urg, Tcb->RcvUp))
+    {
 
       Tcb->RcvUp = Urg;
     } else {
@@ -1480,8 +1491,8 @@
 
   if ((Tcb->State != TCP_CLOSED) &&
       (TcpToSendData (Tcb, 0) == 0) &&
-      (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_ACK_NOW) || (Nbuf->TotalSize != 0))
-      ) {
+      (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_ACK_NOW) || (Nbuf->TotalSize != 0)))
+  {
 
     TcpToSendAck (Tcb);
   }
@@ -1574,7 +1585,12 @@
     goto CLEAN_EXIT;
   }
 
-  IcmpErrStatus = IpIoGetIcmpErrStatus (IcmpErr, Tcb->Sk->IpVersion, 
&IcmpErrIsHard, &IcmpErrNotify);
+  IcmpErrStatus = IpIoGetIcmpErrStatus (
+                    IcmpErr,
+                    Tcb->Sk->IpVersion,
+                    &IcmpErrIsHard,
+                    &IcmpErrNotify
+                    );
 
   if (IcmpErrNotify) {
 


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to