Fix duplicate download IDs.
Fixes https://github.com/profanity-im/profanity/issues/1794 Explanation The problem is the download's identifier. Downloads are given an ID so they can be referenced later when their progress changes. Currently, the download's ID is the download's URL. When you download the same file twice, you have two downloads with the same ID. Download progress updates are shown on the first of both downloads with the same ID. Solution Change the download's ID from its URL to a random number. A random ID is generated when get_random_string() is called from cmd_funcs.c. Several other functions are updated to cope with the new ID format.
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
|
||||
#include "ui/window.h"
|
||||
|
||||
void http_print_transfer(ProfWin* window, char* url, const char* fmt, ...);
|
||||
void http_print_transfer_update(ProfWin* window, char* url, const char* fmt, ...);
|
||||
void http_print_transfer(ProfWin* window, char* id, const char* fmt, ...);
|
||||
void http_print_transfer_update(ProfWin* window, char* id, const char* fmt, ...);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user