1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-16 21:35:24 +00:00
profanity/src
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
..
command Fix unable to download item twice 2024-02-28 07:23:59 -07:00
config Update copyright to 2024 2024-01-22 16:03:48 +01:00
event Update copyright to 2024 2024-01-22 16:03:48 +01:00
omemo Update copyright to 2024 2024-01-22 16:03:48 +01:00
otr g_free() to auto_gfree, introduce auto_guchar 2023-07-13 17:04:59 +02:00
pgp Update copyright to 2024 2024-01-22 16:03:48 +01:00
plugins Simplify usage of roster_get_display_name() 2023-12-12 18:27:11 +01:00
tools Fix unable to download item twice 2024-02-28 07:23:59 -07:00
ui Undo gmainloop related changes 2024-02-19 17:41:06 +01:00
xmpp Update copyright to 2024 2024-01-22 16:03:48 +01:00
chatlog.c Update copyright to 2024 2024-01-22 16:03:48 +01:00
chatlog.h Split log.c into log.c and chatlog.c 2022-06-28 20:08:38 +02:00
common.c Update copyright to 2024 2024-01-22 16:03:48 +01:00
common.h Rework OMEMO handling on disconnect 2023-12-12 18:26:21 +01:00
database.c Update copyright to 2024 2024-01-22 16:03:48 +01:00
database.h Update copyright to 2024 2024-01-22 16:03:48 +01:00
log.c Update copyright to 2024 2024-01-22 16:03:48 +01:00
log.h Fix some more char* -> gchar*. 2023-08-31 23:14:02 +02:00
main.c Update copyright to 2024 2024-01-22 16:03:48 +01:00
profanity.c Undo gmainloop related changes 2024-02-19 17:41:06 +01:00
profanity.h Undo gmainloop related changes 2024-02-19 17:41:06 +01:00