Fossil SCM
Always do at least two cycles with no file transfers before quiting.
Commit
35d7ba08aca1768ba4b61bd6d9e2dcc2e3e01c70
Parent
0c102d06c3ba371…
1 file changed
+9
-1
+9
-1
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -513,10 +513,11 @@ | ||
| 513 | 513 | const char *zPCode = db_get("project-code", 0); |
| 514 | 514 | int nFile = 0; |
| 515 | 515 | int nMsg = 0; |
| 516 | 516 | int nReq = 0; |
| 517 | 517 | int nFileSend; |
| 518 | + int nNoFileCycle = 0; | |
| 518 | 519 | Blob send; /* Text we are sending to the server */ |
| 519 | 520 | Blob recv; /* Reply we got back from the server */ |
| 520 | 521 | Blob line; /* A single line of the reply */ |
| 521 | 522 | Blob aToken[5]; /* A tokenization of line */ |
| 522 | 523 | Blob errmsg; /* Error message */ |
| @@ -704,15 +705,22 @@ | ||
| 704 | 705 | blobarray_reset(aToken, nToken); |
| 705 | 706 | } |
| 706 | 707 | blob_reset(&recv); |
| 707 | 708 | printf("Received: %d files, %d requests, %d other messages\n", |
| 708 | 709 | nFile, nReq, nMsg); |
| 709 | - if( nFileSend + nFile==0 ){ go = 0; } | |
| 710 | + if( nFileSend + nFile==0 ){ | |
| 711 | + nNoFileCycle++; | |
| 712 | + if( nNoFileCycle>1 ){ | |
| 713 | + go = 0; | |
| 714 | + } | |
| 715 | + }else{ | |
| 716 | + nNoFileCycle = 0; | |
| 717 | + } | |
| 710 | 718 | nFile = nReq = nMsg = 0; |
| 711 | 719 | }; |
| 712 | 720 | http_close(); |
| 713 | 721 | db_end_transaction(0); |
| 714 | 722 | db_multi_exec( |
| 715 | 723 | "DROP TABLE onremote;" |
| 716 | 724 | "DROP TABLE pending;" |
| 717 | 725 | ); |
| 718 | 726 | } |
| 719 | 727 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -513,10 +513,11 @@ | |
| 513 | const char *zPCode = db_get("project-code", 0); |
| 514 | int nFile = 0; |
| 515 | int nMsg = 0; |
| 516 | int nReq = 0; |
| 517 | int nFileSend; |
| 518 | Blob send; /* Text we are sending to the server */ |
| 519 | Blob recv; /* Reply we got back from the server */ |
| 520 | Blob line; /* A single line of the reply */ |
| 521 | Blob aToken[5]; /* A tokenization of line */ |
| 522 | Blob errmsg; /* Error message */ |
| @@ -704,15 +705,22 @@ | |
| 704 | blobarray_reset(aToken, nToken); |
| 705 | } |
| 706 | blob_reset(&recv); |
| 707 | printf("Received: %d files, %d requests, %d other messages\n", |
| 708 | nFile, nReq, nMsg); |
| 709 | if( nFileSend + nFile==0 ){ go = 0; } |
| 710 | nFile = nReq = nMsg = 0; |
| 711 | }; |
| 712 | http_close(); |
| 713 | db_end_transaction(0); |
| 714 | db_multi_exec( |
| 715 | "DROP TABLE onremote;" |
| 716 | "DROP TABLE pending;" |
| 717 | ); |
| 718 | } |
| 719 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -513,10 +513,11 @@ | |
| 513 | const char *zPCode = db_get("project-code", 0); |
| 514 | int nFile = 0; |
| 515 | int nMsg = 0; |
| 516 | int nReq = 0; |
| 517 | int nFileSend; |
| 518 | int nNoFileCycle = 0; |
| 519 | Blob send; /* Text we are sending to the server */ |
| 520 | Blob recv; /* Reply we got back from the server */ |
| 521 | Blob line; /* A single line of the reply */ |
| 522 | Blob aToken[5]; /* A tokenization of line */ |
| 523 | Blob errmsg; /* Error message */ |
| @@ -704,15 +705,22 @@ | |
| 705 | blobarray_reset(aToken, nToken); |
| 706 | } |
| 707 | blob_reset(&recv); |
| 708 | printf("Received: %d files, %d requests, %d other messages\n", |
| 709 | nFile, nReq, nMsg); |
| 710 | if( nFileSend + nFile==0 ){ |
| 711 | nNoFileCycle++; |
| 712 | if( nNoFileCycle>1 ){ |
| 713 | go = 0; |
| 714 | } |
| 715 | }else{ |
| 716 | nNoFileCycle = 0; |
| 717 | } |
| 718 | nFile = nReq = nMsg = 0; |
| 719 | }; |
| 720 | http_close(); |
| 721 | db_end_transaction(0); |
| 722 | db_multi_exec( |
| 723 | "DROP TABLE onremote;" |
| 724 | "DROP TABLE pending;" |
| 725 | ); |
| 726 | } |
| 727 |