Browse code

Set web.first_key only on the first uploadStart message

UploadStart is sent by the phone app whenever a data line is appended
to an empty queue. It can be useful to compute the time spent sending
data, compared to the time spent waiting for more data to be sent from
the watch. However only the furst uploadStart message is useful for
determining the first uploaded key.

Natasha Kerensikova authored on31/05/2016 23:02:43
Showing1 changed files
... ...
@@ -466,8 +466,10 @@ handle_received_tuple(Tuple *tuple) {
466 466
 		break;
467 467
 
468 468
 	    case MSG_KEY_UPLOAD_START:
469
-		web.first_key = tuple_uint(tuple);
470
-		web.start_time = time(0);
469
+		if (!web.first_key) {
470
+			web.first_key = tuple_uint(tuple);
471
+			web.start_time = time(0);
472
+		}
471 473
 		break;
472 474
 
473 475
 	    case MSG_KEY_UPLOAD_FAILED: