forked from j62/ctbrec
1
0
Fork 0

Make login methods synchronized

Add synchronized modifier to the login methods, so that only one thread
at a time tries to login. All the following threads then should be able
to use the session cookies
This commit is contained in:
0xboobface 2018-12-12 12:48:45 +01:00
parent a5ec00c936
commit c478f6b0f1
10 changed files with 10 additions and 10 deletions

View File

@ -44,7 +44,7 @@ public class BongaCamsSiteUi implements SiteUI {
}
@Override
public boolean login() throws IOException {
public synchronized boolean login() throws IOException {
boolean automaticLogin = bongaCams.login();
if(automaticLogin) {
return true;

View File

@ -44,7 +44,7 @@ public class Cam4SiteUi implements SiteUI {
}
@Override
public boolean login() throws IOException {
public synchronized boolean login() throws IOException {
boolean automaticLogin = cam4.login();
if(automaticLogin) {
return true;

View File

@ -45,7 +45,7 @@ public class CamsodaSiteUi implements SiteUI {
}
@Override
public boolean login() throws IOException {
public synchronized boolean login() throws IOException {
boolean automaticLogin = camsoda.login();
return automaticLogin;
}

View File

@ -30,7 +30,7 @@ public class ChaturbateSiteUi implements SiteUI {
}
@Override
public boolean login() throws IOException {
public synchronized boolean login() throws IOException {
return chaturbate.login();
}

View File

@ -30,7 +30,7 @@ public class MyFreeCamsSiteUi implements SiteUI {
}
@Override
public boolean login() throws IOException {
public synchronized boolean login() throws IOException {
return myFreeCams.login();
}

View File

@ -94,7 +94,7 @@ public class BongaCams extends AbstractSite {
}
@Override
public boolean login() throws IOException {
public synchronized boolean login() throws IOException {
return credentialsAvailable() && getHttpClient().login();
}

View File

@ -64,7 +64,7 @@ public class Cam4 extends AbstractSite {
}
@Override
public boolean login() throws IOException {
public synchronized boolean login() throws IOException {
return credentialsAvailable() && getHttpClient().login();
}

View File

@ -82,7 +82,7 @@ public class Camsoda extends AbstractSite {
}
@Override
public boolean login() throws IOException {
public synchronized boolean login() throws IOException {
return credentialsAvailable() && getHttpClient().login();
}

View File

@ -105,7 +105,7 @@ public class Chaturbate extends AbstractSite {
}
@Override
public boolean login() throws IOException {
public synchronized boolean login() throws IOException {
return credentialsAvailable() && getHttpClient().login();
}

View File

@ -31,7 +31,7 @@ public class MyFreeCams extends AbstractSite {
}
@Override
public boolean login() throws IOException {
public synchronized boolean login() throws IOException {
return credentialsAvailable() && getHttpClient().login();
}