Using UpnpReadHttpGet to download large files causes the application to
crash. This happens when the file being downloaded exceeds the device memory - entirely possible when transferring video files. The programmatic cause is that the logic implemented in the function http_ReadHttpGet (which UpnpReadHttpGet calls) reads the entire file into memory. The fix modifies the existing logic to discard data after it's been read; there's no reason to keep it around since the caller of UpnpReadHttpGet already has a copy of it. This issue exists in 1.6.6 as well as the latest sources. Patch submitted by Chandra (inactiveneurons).
This commit is contained in:
@@ -193,7 +193,8 @@ typedef struct // http_message_t
|
||||
|
||||
// private fields
|
||||
membuffer msg; // entire raw message
|
||||
char *urlbuf; // storage for url string
|
||||
char *urlbuf; // storage for url string
|
||||
size_t entity_offset;
|
||||
} http_message_t;
|
||||
|
||||
typedef struct // http_parser_t
|
||||
|
||||
Reference in New Issue
Block a user