]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/Deluge/ObjectTransferP.nc
This commit from Chieh-Jan (Mike) Liang contains the following:
[tinyos-2.x.git] / tos / lib / net / Deluge / ObjectTransferP.nc
index 777a6cfab0d225a102051821b45d8abeb4f4b40d..ab92c554a6952aa9eeaf22f2bf6fba32da215ae0 100644 (file)
@@ -111,8 +111,8 @@ implementation
       resetTimer();
     } else {
       call DelugePageTransfer.setWorkingPage(DELUGE_INVALID_OBJID, DELUGE_INVALID_PGNUM);
-      state = S_SYNC;
       call ObjectTransfer.stop();
+      state = S_SYNC;
       call BlockWrite.sync[cont_receive_img_num]();
     }
   }
@@ -248,9 +248,11 @@ implementation
         setNextPage();
       } else {
         call DelugePageTransfer.setWorkingPage(curObjDesc.objid, curObjDesc.numPgsComplete);
-        state = S_SYNC;
         call ObjectTransfer.stop();
-        call BlockWrite.sync[cont_receive_img_num]();
+        state = S_SYNC;
+        if (call BlockWrite.sync[cont_receive_img_num]() != SUCCESS) {
+          post signalObjRecvDone();
+        }
       }
     }
   }