Skip to content

Commit

Permalink
Add check when no proxy adress is set but http proxy option is activated
Browse files Browse the repository at this point in the history
  • Loading branch information
gillesdubois committed Nov 10, 2017
1 parent 5a1a4dc commit fbeac15
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/src/main/java/org/ocs/android/actions/OCSProtocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import android.content.Context;
import android.os.AsyncTask;
import android.text.TextUtils;

import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
Expand Down Expand Up @@ -191,9 +192,13 @@ public String sendmethod(File pFile, String server, boolean gziped) throws OCSPr
DefaultHttpClient httpClient = getNewHttpClient(OCSSettings.getInstance().isSSLStrict());

if (ocssettings.isProxy()) {
ocslog.debug("Use proxy : " + ocssettings.getProxyAdr());
HttpHost proxy = new HttpHost(ocssettings.getProxyAdr(), ocssettings.getProxyPort());
httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
if(!TextUtils.isEmpty(ocssettings.getProxyAdr())){
ocslog.debug("Use proxy : " + ocssettings.getProxyAdr());
HttpHost proxy = new HttpHost(ocssettings.getProxyAdr(), ocssettings.getProxyPort());
httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
}else{
ocslog.debug("Invalid proxy settings");
}
}
if (ocssettings.isAuth()) {
ocslog.debug("Use AUTH : " + ocssettings.getLogin() + "/*****");
Expand Down

0 comments on commit fbeac15

Please sign in to comment.