1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00
profanity/src/tools
ike08 23fa4750ff Fix unable to download item twice
## Summary

Partial fix for https://github.com/profanity-im/profanity/issues/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.
2024-02-28 07:23:59 -07:00
..
aesgcm_download.c Fix unable to download item twice 2024-02-28 07:23:59 -07:00
aesgcm_download.h Fix duplicate download IDs. 2023-03-09 15:02:26 -07:00
autocomplete.c Change char->free to auto_char char for autocleanup 2023-07-11 13:26:37 +02:00
autocomplete.h Fix quote and url autocompletion for MAM and history 2023-02-13 23:40:58 +02:00
bookmark_ignore.c Update copyright to 2024 2024-01-22 16:03:48 +01:00
bookmark_ignore.h Update copyright to 2024 2024-01-22 16:03:48 +01:00
clipboard.c Update copyright to 2024 2024-01-22 16:03:48 +01:00
clipboard.h Update copyright to 2024 2024-01-22 16:03:48 +01:00
editor.c Update copyright to 2024 2024-01-22 16:03:48 +01:00
editor.h Update copyright to 2024 2024-01-22 16:03:48 +01:00
http_common.c Add url support (downloading) to /plugins install 2023-05-16 15:57:07 +02:00
http_common.h Fix duplicate download IDs. 2023-03-09 15:02:26 -07:00
http_download.c Update copyright to 2024 2024-01-22 16:03:48 +01:00
http_download.h Add url support (downloading) to /plugins install 2023-05-16 15:57:07 +02:00
http_upload.c Don't crash when using /plugins install disconnected 2023-08-28 07:55:29 +02:00
http_upload.h Update to the newest version of XEP 0363 (HTTP Upload) 2021-03-11 17:11:22 +01:00
parser.c g_free() to auto_gfree, introduce auto_guchar 2023-07-13 17:04:59 +02:00
parser.h Fix /correct quotation marks usage 2020-07-23 09:40:22 +02:00
plugin_download.c Update copyright to 2024 2024-01-22 16:03:48 +01:00
plugin_download.h Update copyright to 2024 2024-01-22 16:03:48 +01:00