forked from j62/ctbrec
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:
parent
a5ec00c936
commit
c478f6b0f1
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public class ChaturbateSiteUi implements SiteUI {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean login() throws IOException {
|
||||
public synchronized boolean login() throws IOException {
|
||||
return chaturbate.login();
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ public class MyFreeCamsSiteUi implements SiteUI {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean login() throws IOException {
|
||||
public synchronized boolean login() throws IOException {
|
||||
return myFreeCams.login();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue