Please sign in to comment.
Fix a memory leak in Easy
This commit fix an issue in Easy when the method is :post. The params were garbage collected, especially with a large number of requests. The params are now copied to libCURL, so we're sure we won't leak any more, even if the referenced objects are GC. This refer to the libcurl doc: "CURLOPT_POSTFIELDS ... The pointed data are NOT copied by the library: as a consequence, they must be preserved by the calling application until the transfer finishes. " We're now using : "CURLOPT_COPYPOSTFIELDS ... Pass a char * as parameter, which should be the full data to post in an HTTP POST operation. It behaves as the CURLOPT_POSTFIELDS option, but the original data are copied by the library, allowing the application to overwrite the original data after setting this option. "
- Loading branch information...