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

Fix unable to download item twice #1958

Merged
merged 1 commit into from
Mar 1, 2024
Merged

Fix unable to download item twice #1958

merged 1 commit into from
Mar 1, 2024

Commits on Feb 28, 2024

  1. Fix unable to download item twice

    ## Summary
    
    Partial fix for #1939  
    
    > When doing the same in an unencrypted (no e2ee) chat there is no Downloading… message at all but the file is downloaded.  
    
    Download a file twice with `/url save`, the second download will not print download progress to the window.  
    
    The cause is `HTTPDownload`'s `silent` variable is not initialized; so, `silent` points to a second-hand stack memory address with old data. `silent` references data, so the `if` statement will fail in **src/tools/http_download.c:206** and download progress will not print to the window.  
    
    The fix is to initialize `silent` in both encrypted and unencrypted file download scenarios.  
    
    ## Testing
    
    Valgrind: Yes  
    
    - `/url save` without OMEMO  
      **SUCCESS**: Try three times with the same URL and download status will display every time.  
    
    - `/url save` with OMEMO  
      **SUCCESS**: Try three times with the same URL and download status will display every time.  
    
    - `/plugins install https://raw.githubusercontent.com/profanity-im/profanity-plugins/master/stable/sounds.py`  
      **SUCCESS**: Try once and download progress is hidden.
    ike08 committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    23fa475 View commit details
    Browse the repository at this point in the history