Fossil SCM
For clone and sync, report the correct network traffic totals even if those totals exceed 2 GiB.
Commit
a9e05e23e9f085b35b1b0bc9350d6121b01fb53c
Parent
f6263ed6ce5fb60…
2 files changed
+3
-3
+2
-2
+3
-3
| --- src/http_transport.c | ||
| +++ src/http_transport.c | ||
| @@ -30,12 +30,12 @@ | ||
| 30 | 30 | int isOpen; /* True when the transport layer is open */ |
| 31 | 31 | char *pBuf; /* Buffer used to hold the reply */ |
| 32 | 32 | int nAlloc; /* Space allocated for transportBuf[] */ |
| 33 | 33 | int nUsed ; /* Space of transportBuf[] used */ |
| 34 | 34 | int iCursor; /* Next unread by in transportBuf[] */ |
| 35 | - int nSent; /* Number of bytes sent */ | |
| 36 | - int nRcvd; /* Number of bytes received */ | |
| 35 | + i64 nSent; /* Number of bytes sent */ | |
| 36 | + i64 nRcvd; /* Number of bytes received */ | |
| 37 | 37 | FILE *pFile; /* File I/O for FILE: */ |
| 38 | 38 | char *zOutFile; /* Name of outbound file for FILE: */ |
| 39 | 39 | char *zInFile; /* Name of inbound file for FILE: */ |
| 40 | 40 | } transport = { |
| 41 | 41 | 0, 0, 0, 0, 0, 0, 0 |
| @@ -64,11 +64,11 @@ | ||
| 64 | 64 | |
| 65 | 65 | /* |
| 66 | 66 | ** Retrieve send/receive counts from the transport layer. If "resetFlag" |
| 67 | 67 | ** is true, then reset the counts. |
| 68 | 68 | */ |
| 69 | -void transport_stats(int *pnSent, int *pnRcvd, int resetFlag){ | |
| 69 | +void transport_stats(i64 *pnSent, i64 *pnRcvd, int resetFlag){ | |
| 70 | 70 | if( pnSent ) *pnSent = transport.nSent; |
| 71 | 71 | if( pnRcvd ) *pnRcvd = transport.nRcvd; |
| 72 | 72 | if( resetFlag ){ |
| 73 | 73 | transport.nSent = 0; |
| 74 | 74 | transport.nRcvd = 0; |
| 75 | 75 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -30,12 +30,12 @@ | |
| 30 | int isOpen; /* True when the transport layer is open */ |
| 31 | char *pBuf; /* Buffer used to hold the reply */ |
| 32 | int nAlloc; /* Space allocated for transportBuf[] */ |
| 33 | int nUsed ; /* Space of transportBuf[] used */ |
| 34 | int iCursor; /* Next unread by in transportBuf[] */ |
| 35 | int nSent; /* Number of bytes sent */ |
| 36 | int nRcvd; /* Number of bytes received */ |
| 37 | FILE *pFile; /* File I/O for FILE: */ |
| 38 | char *zOutFile; /* Name of outbound file for FILE: */ |
| 39 | char *zInFile; /* Name of inbound file for FILE: */ |
| 40 | } transport = { |
| 41 | 0, 0, 0, 0, 0, 0, 0 |
| @@ -64,11 +64,11 @@ | |
| 64 | |
| 65 | /* |
| 66 | ** Retrieve send/receive counts from the transport layer. If "resetFlag" |
| 67 | ** is true, then reset the counts. |
| 68 | */ |
| 69 | void transport_stats(int *pnSent, int *pnRcvd, int resetFlag){ |
| 70 | if( pnSent ) *pnSent = transport.nSent; |
| 71 | if( pnRcvd ) *pnRcvd = transport.nRcvd; |
| 72 | if( resetFlag ){ |
| 73 | transport.nSent = 0; |
| 74 | transport.nRcvd = 0; |
| 75 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -30,12 +30,12 @@ | |
| 30 | int isOpen; /* True when the transport layer is open */ |
| 31 | char *pBuf; /* Buffer used to hold the reply */ |
| 32 | int nAlloc; /* Space allocated for transportBuf[] */ |
| 33 | int nUsed ; /* Space of transportBuf[] used */ |
| 34 | int iCursor; /* Next unread by in transportBuf[] */ |
| 35 | i64 nSent; /* Number of bytes sent */ |
| 36 | i64 nRcvd; /* Number of bytes received */ |
| 37 | FILE *pFile; /* File I/O for FILE: */ |
| 38 | char *zOutFile; /* Name of outbound file for FILE: */ |
| 39 | char *zInFile; /* Name of inbound file for FILE: */ |
| 40 | } transport = { |
| 41 | 0, 0, 0, 0, 0, 0, 0 |
| @@ -64,11 +64,11 @@ | |
| 64 | |
| 65 | /* |
| 66 | ** Retrieve send/receive counts from the transport layer. If "resetFlag" |
| 67 | ** is true, then reset the counts. |
| 68 | */ |
| 69 | void transport_stats(i64 *pnSent, i64 *pnRcvd, int resetFlag){ |
| 70 | if( pnSent ) *pnSent = transport.nSent; |
| 71 | if( pnRcvd ) *pnRcvd = transport.nRcvd; |
| 72 | if( resetFlag ){ |
| 73 | transport.nSent = 0; |
| 74 | transport.nRcvd = 0; |
| 75 |
+2
-2
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1124,11 +1124,11 @@ | ||
| 1124 | 1124 | int nFileSend = 0; |
| 1125 | 1125 | int origConfigRcvMask; /* Original value of configRcvMask */ |
| 1126 | 1126 | int nFileRecv; /* Number of files received */ |
| 1127 | 1127 | int mxPhantomReq = 200; /* Max number of phantoms to request per comm */ |
| 1128 | 1128 | const char *zCookie; /* Server cookie */ |
| 1129 | - int nSent, nRcvd; /* Bytes sent and received (after compression) */ | |
| 1129 | + i64 nSent, nRcvd; /* Bytes sent and received (after compression) */ | |
| 1130 | 1130 | int cloneSeqno = 1; /* Sequence number for clones */ |
| 1131 | 1131 | Blob send; /* Text we are sending to the server */ |
| 1132 | 1132 | Blob recv; /* Reply we got back from the server */ |
| 1133 | 1133 | Xfer xfer; /* Transfer data */ |
| 1134 | 1134 | int pctDone; /* Percentage done with a message */ |
| @@ -1566,15 +1566,15 @@ | ||
| 1566 | 1566 | |
| 1567 | 1567 | /* Stop the cycle if the server sends a "clone_seqno 0" card */ |
| 1568 | 1568 | if( cloneSeqno<=0 ) go = 0; |
| 1569 | 1569 | }; |
| 1570 | 1570 | transport_stats(&nSent, &nRcvd, 1); |
| 1571 | - fossil_print("Total network traffic: %d bytes sent, %d bytes received\n", | |
| 1571 | + fossil_print("Total network traffic: %lld bytes sent, %lld bytes received\n", | |
| 1572 | 1572 | nSent, nRcvd); |
| 1573 | 1573 | transport_close(); |
| 1574 | 1574 | transport_global_shutdown(); |
| 1575 | 1575 | db_multi_exec("DROP TABLE onremote"); |
| 1576 | 1576 | manifest_crosslink_end(); |
| 1577 | 1577 | content_enable_dephantomize(1); |
| 1578 | 1578 | db_end_transaction(0); |
| 1579 | 1579 | return nErr; |
| 1580 | 1580 | } |
| 1581 | 1581 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1124,11 +1124,11 @@ | |
| 1124 | int nFileSend = 0; |
| 1125 | int origConfigRcvMask; /* Original value of configRcvMask */ |
| 1126 | int nFileRecv; /* Number of files received */ |
| 1127 | int mxPhantomReq = 200; /* Max number of phantoms to request per comm */ |
| 1128 | const char *zCookie; /* Server cookie */ |
| 1129 | int nSent, nRcvd; /* Bytes sent and received (after compression) */ |
| 1130 | int cloneSeqno = 1; /* Sequence number for clones */ |
| 1131 | Blob send; /* Text we are sending to the server */ |
| 1132 | Blob recv; /* Reply we got back from the server */ |
| 1133 | Xfer xfer; /* Transfer data */ |
| 1134 | int pctDone; /* Percentage done with a message */ |
| @@ -1566,15 +1566,15 @@ | |
| 1566 | |
| 1567 | /* Stop the cycle if the server sends a "clone_seqno 0" card */ |
| 1568 | if( cloneSeqno<=0 ) go = 0; |
| 1569 | }; |
| 1570 | transport_stats(&nSent, &nRcvd, 1); |
| 1571 | fossil_print("Total network traffic: %d bytes sent, %d bytes received\n", |
| 1572 | nSent, nRcvd); |
| 1573 | transport_close(); |
| 1574 | transport_global_shutdown(); |
| 1575 | db_multi_exec("DROP TABLE onremote"); |
| 1576 | manifest_crosslink_end(); |
| 1577 | content_enable_dephantomize(1); |
| 1578 | db_end_transaction(0); |
| 1579 | return nErr; |
| 1580 | } |
| 1581 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1124,11 +1124,11 @@ | |
| 1124 | int nFileSend = 0; |
| 1125 | int origConfigRcvMask; /* Original value of configRcvMask */ |
| 1126 | int nFileRecv; /* Number of files received */ |
| 1127 | int mxPhantomReq = 200; /* Max number of phantoms to request per comm */ |
| 1128 | const char *zCookie; /* Server cookie */ |
| 1129 | i64 nSent, nRcvd; /* Bytes sent and received (after compression) */ |
| 1130 | int cloneSeqno = 1; /* Sequence number for clones */ |
| 1131 | Blob send; /* Text we are sending to the server */ |
| 1132 | Blob recv; /* Reply we got back from the server */ |
| 1133 | Xfer xfer; /* Transfer data */ |
| 1134 | int pctDone; /* Percentage done with a message */ |
| @@ -1566,15 +1566,15 @@ | |
| 1566 | |
| 1567 | /* Stop the cycle if the server sends a "clone_seqno 0" card */ |
| 1568 | if( cloneSeqno<=0 ) go = 0; |
| 1569 | }; |
| 1570 | transport_stats(&nSent, &nRcvd, 1); |
| 1571 | fossil_print("Total network traffic: %lld bytes sent, %lld bytes received\n", |
| 1572 | nSent, nRcvd); |
| 1573 | transport_close(); |
| 1574 | transport_global_shutdown(); |
| 1575 | db_multi_exec("DROP TABLE onremote"); |
| 1576 | manifest_crosslink_end(); |
| 1577 | content_enable_dephantomize(1); |
| 1578 | db_end_transaction(0); |
| 1579 | return nErr; |
| 1580 | } |
| 1581 |