Skip to content

Commit 0716b74

Browse files
author
Ivan Stoev
committed
Fixing some digest missmatch.
1 parent ac7f5a6 commit 0716b74

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pdiff.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ static pthread_mutex_t diff_mutex=PTHREAD_MUTEX_INITIALIZER;
7777
static int initialdownload=0;
7878
static paccount_cache_callback_t psync_cache_callback=NULL;
7979
static uint32_t psync_is_business=0;
80+
static int psync_digest = 1;
8081

8182
void do_register_account_events_callback(paccount_cache_callback_t callback){
8283
psync_cache_callback=callback;
@@ -169,7 +170,7 @@ static psync_socket *get_connected_socket(){
169170
int saveauth, isbusiness, cryptosetup;
170171
auth=user=pass=NULL;
171172
psync_is_business = 0;
172-
int digest = 1;
173+
173174
while (1){
174175
psync_free(auth);
175176
psync_free(user);
@@ -200,7 +201,7 @@ static psync_socket *get_connected_socket(){
200201
device=psync_deviceid();
201202

202203
if (user && pass && pass[0])
203-
if (digest)
204+
if (psync_digest)
204205
res=get_userinfo_user_pass(sock, user, pass, device);
205206
else
206207
{
@@ -239,6 +240,11 @@ static psync_socket *get_connected_socket(){
239240
psync_socket_close(sock);
240241
psync_free(res);
241242
if (result==2000){
243+
if (psync_digest)
244+
{
245+
psync_digest = 0;
246+
continue;
247+
}
242248
if (user && pass)
243249
psync_set_status(PSTATUS_TYPE_AUTH, PSTATUS_AUTH_BADLOGIN);
244250
else
@@ -252,7 +258,7 @@ static psync_socket *get_connected_socket(){
252258
psync_wait_status(PSTATUS_TYPE_AUTH, PSTATUS_AUTH_PROVIDED);
253259
} else if (result == 2237)
254260
{
255-
digest = 0;
261+
psync_digest = 0;
256262
continue;
257263
}
258264

0 commit comments

Comments
 (0)