Fossil SCM
Defer output of stats until the transport has been opened. This will also help with HTTPs when using client peer certificates (or unrecognized CAs).
Commit
d1771cd1388f96801c1ea07235c5ee8459f50c55
Parent
0b643946f0cc3c4…
1 file changed
+12
-9
+12
-9
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1465,11 +1465,22 @@ | ||
| 1465 | 1465 | */ |
| 1466 | 1466 | zRandomness = db_text(0, "SELECT hex(randomblob(20))"); |
| 1467 | 1467 | blob_appendf(&send, "# %s\n", zRandomness); |
| 1468 | 1468 | free(zRandomness); |
| 1469 | 1469 | |
| 1470 | + if( syncFlags & SYNC_VERBOSE ){ | |
| 1471 | + fossil_print("waiting for server..."); | |
| 1472 | + } | |
| 1473 | + fflush(stdout); | |
| 1470 | 1474 | /* Exchange messages with the server */ |
| 1475 | + if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0, | |
| 1476 | + MAX_REDIRECTS) ){ | |
| 1477 | + nErr++; | |
| 1478 | + break; | |
| 1479 | + } | |
| 1480 | + | |
| 1481 | + /* Output current stats */ | |
| 1471 | 1482 | if( syncFlags & SYNC_VERBOSE ){ |
| 1472 | 1483 | fossil_print(zValueFormat, "Sent:", |
| 1473 | 1484 | blob_size(&send), nCardSent+xfer.nGimmeSent+xfer.nIGotSent, |
| 1474 | 1485 | xfer.nFileSent, xfer.nDeltaSent); |
| 1475 | 1486 | }else{ |
| @@ -1481,19 +1492,11 @@ | ||
| 1481 | 1492 | nCardRcvd = 0; |
| 1482 | 1493 | xfer.nFileSent = 0; |
| 1483 | 1494 | xfer.nDeltaSent = 0; |
| 1484 | 1495 | xfer.nGimmeSent = 0; |
| 1485 | 1496 | xfer.nIGotSent = 0; |
| 1486 | - if( syncFlags & SYNC_VERBOSE ){ | |
| 1487 | - fossil_print("waiting for server..."); | |
| 1488 | - } | |
| 1489 | - fflush(stdout); | |
| 1490 | - if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0, | |
| 1491 | - MAX_REDIRECTS) ){ | |
| 1492 | - nErr++; | |
| 1493 | - break; | |
| 1494 | - } | |
| 1497 | + | |
| 1495 | 1498 | lastPctDone = -1; |
| 1496 | 1499 | blob_reset(&send); |
| 1497 | 1500 | rArrivalTime = db_double(0.0, "SELECT julianday('now')"); |
| 1498 | 1501 | |
| 1499 | 1502 | /* Send the send-private pragma if we are trying to sync private data */ |
| 1500 | 1503 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1465,11 +1465,22 @@ | |
| 1465 | */ |
| 1466 | zRandomness = db_text(0, "SELECT hex(randomblob(20))"); |
| 1467 | blob_appendf(&send, "# %s\n", zRandomness); |
| 1468 | free(zRandomness); |
| 1469 | |
| 1470 | /* Exchange messages with the server */ |
| 1471 | if( syncFlags & SYNC_VERBOSE ){ |
| 1472 | fossil_print(zValueFormat, "Sent:", |
| 1473 | blob_size(&send), nCardSent+xfer.nGimmeSent+xfer.nIGotSent, |
| 1474 | xfer.nFileSent, xfer.nDeltaSent); |
| 1475 | }else{ |
| @@ -1481,19 +1492,11 @@ | |
| 1481 | nCardRcvd = 0; |
| 1482 | xfer.nFileSent = 0; |
| 1483 | xfer.nDeltaSent = 0; |
| 1484 | xfer.nGimmeSent = 0; |
| 1485 | xfer.nIGotSent = 0; |
| 1486 | if( syncFlags & SYNC_VERBOSE ){ |
| 1487 | fossil_print("waiting for server..."); |
| 1488 | } |
| 1489 | fflush(stdout); |
| 1490 | if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0, |
| 1491 | MAX_REDIRECTS) ){ |
| 1492 | nErr++; |
| 1493 | break; |
| 1494 | } |
| 1495 | lastPctDone = -1; |
| 1496 | blob_reset(&send); |
| 1497 | rArrivalTime = db_double(0.0, "SELECT julianday('now')"); |
| 1498 | |
| 1499 | /* Send the send-private pragma if we are trying to sync private data */ |
| 1500 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1465,11 +1465,22 @@ | |
| 1465 | */ |
| 1466 | zRandomness = db_text(0, "SELECT hex(randomblob(20))"); |
| 1467 | blob_appendf(&send, "# %s\n", zRandomness); |
| 1468 | free(zRandomness); |
| 1469 | |
| 1470 | if( syncFlags & SYNC_VERBOSE ){ |
| 1471 | fossil_print("waiting for server..."); |
| 1472 | } |
| 1473 | fflush(stdout); |
| 1474 | /* Exchange messages with the server */ |
| 1475 | if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0, |
| 1476 | MAX_REDIRECTS) ){ |
| 1477 | nErr++; |
| 1478 | break; |
| 1479 | } |
| 1480 | |
| 1481 | /* Output current stats */ |
| 1482 | if( syncFlags & SYNC_VERBOSE ){ |
| 1483 | fossil_print(zValueFormat, "Sent:", |
| 1484 | blob_size(&send), nCardSent+xfer.nGimmeSent+xfer.nIGotSent, |
| 1485 | xfer.nFileSent, xfer.nDeltaSent); |
| 1486 | }else{ |
| @@ -1481,19 +1492,11 @@ | |
| 1492 | nCardRcvd = 0; |
| 1493 | xfer.nFileSent = 0; |
| 1494 | xfer.nDeltaSent = 0; |
| 1495 | xfer.nGimmeSent = 0; |
| 1496 | xfer.nIGotSent = 0; |
| 1497 | |
| 1498 | lastPctDone = -1; |
| 1499 | blob_reset(&send); |
| 1500 | rArrivalTime = db_double(0.0, "SELECT julianday('now')"); |
| 1501 | |
| 1502 | /* Send the send-private pragma if we are trying to sync private data */ |
| 1503 |