Skip to content

Commit 7c2403e

Browse files
committed
cloudsync_network_sync now always returns an int value
0 => no changes -1 => error else the number of rows applied
1 parent 8bdfa70 commit 7c2403e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/cloudsync.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "sqlite3.h"
1717
#endif
1818

19-
#define CLOUDSYNC_VERSION "0.8.1"
19+
#define CLOUDSYNC_VERSION "0.8.2"
2020

2121
int sqlite3_cloudsync_init (sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi);
2222

src/network.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,12 +687,15 @@ void cloudsync_network_sync (sqlite3_context *context, int wait_ms, int max_retr
687687
cloudsync_network_send_changes(context, 0, NULL);
688688

689689
int retries = 0;
690+
int nrows = 0;
690691
while (retries < max_retries) {
691-
int nrows = cloudsync_network_check_internal(context);
692+
nrows = cloudsync_network_check_internal(context);
692693
if (nrows > 0) break;
693694
else sqlite3_sleep(wait_ms);
694695
retries++;
695696
}
697+
698+
sqlite3_result_int(context, nrows);
696699
}
697700

698701
void cloudsync_network_sync0 (sqlite3_context *context, int argc, sqlite3_value **argv) {

0 commit comments

Comments
 (0)