Skip to content

Bug multiple executeRequest(httpget) #1

Open
@cala988

Description

@cala988

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());
            }
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions