Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug multiple executeRequest(httpget) #1

Open
cala988 opened this issue May 24, 2017 · 0 comments
Open

Bug multiple executeRequest(httpget) #1

cala988 opened this issue May 24, 2017 · 0 comments

Comments

@cala988
Copy link

cala988 commented May 24, 2017

Hi,

Thanks for the code.
I find a bug when I call multiple executeRequest(httpget) in a process.
The code not responding in response = httpclient.execute(request);
This happens because the connection does not close when an error occurs.

Solution:
Its neccesary put in catch response.close() in method get();
Example:

HttpGet httpget = new HttpGet(completeUrl);        
try{  
          HashMap<String,Object> resoult = this.executeRequest(httpget);
}
catch(Exception ex){
            try {
                response.close();
                throw new PrestaShopWebServiceException("Bad HTTP response : "+ex.toString());
            } catch (IOException ex1) {
                throw new PrestaShopWebServiceException("Bad HTTP response : "+ex1.toString());
            }
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant