[GH-ISSUE #2452] s3fscurl->DestroyCurlHandle(true, false) Why is the second parameter set to false ,but all other calls are true. #1209

Closed
opened 2026-03-04 01:52:13 +03:00 by kerem · 1 comment
Owner

Originally created by @loongyiyao on GitHub (May 7, 2024).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2452

void* S3fsMultiCurl::RequestPerformWrapper(void* arg)
{
    S3fsCurl* s3fscurl= static_cast<S3fsCurl*>(arg);
    void*     result  = NULL;
    if(!s3fscurl){
        return (void*)(intptr_t)(-EIO);
    }
    if(s3fscurl->fpLazySetup){
        if(!s3fscurl->fpLazySetup(s3fscurl)){
            S3FS_PRN_ERR("Failed to lazy setup, then respond EIO.");
            result  = (void*)(intptr_t)(-EIO);
        }
    }

    if(!result){
        result = (void*)(intptr_t)(s3fscurl->RequestPerform());
        s3fscurl->DestroyCurlHandle(true, false);
    }

    AutoLock  lock(s3fscurl->completed_tids_lock);
    s3fscurl->completed_tids->push_back(pthread_self());
    s3fscurl->sem->post();

    return result;
}

Can you help me explain why the second parameter of this function needs to be set to false? Will setting it to false not result in a memory leak。
function::s3fscurl->DestroyCurlHandle(true, false);

Originally created by @loongyiyao on GitHub (May 7, 2024). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2452 ``` void* S3fsMultiCurl::RequestPerformWrapper(void* arg) { S3fsCurl* s3fscurl= static_cast<S3fsCurl*>(arg); void* result = NULL; if(!s3fscurl){ return (void*)(intptr_t)(-EIO); } if(s3fscurl->fpLazySetup){ if(!s3fscurl->fpLazySetup(s3fscurl)){ S3FS_PRN_ERR("Failed to lazy setup, then respond EIO."); result = (void*)(intptr_t)(-EIO); } } if(!result){ result = (void*)(intptr_t)(s3fscurl->RequestPerform()); s3fscurl->DestroyCurlHandle(true, false); } AutoLock lock(s3fscurl->completed_tids_lock); s3fscurl->completed_tids->push_back(pthread_self()); s3fscurl->sem->post(); return result; } ``` Can you help me explain why the second parameter of this function needs to be set to false? Will setting it to false not result in a memory leak。 function::s3fscurl->DestroyCurlHandle(true, false);
kerem closed this issue 2026-03-04 01:52:13 +03:00
Author
Owner

@loongyiyao commented on GitHub (May 10, 2024):

i has understanded

<!-- gh-comment-id:2104028452 --> @loongyiyao commented on GitHub (May 10, 2024): i has understanded
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#1209
No description provided.