Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#9950 closed Patch - Bug Fix (fixed)

[PATCH] DownloadManager SEGV after timeout

Reported by: Lawrence Rust <lvr@…> Owned by: cpinkham
Priority: minor Milestone: 0.25
Component: MythTV - General Version: Master Head
Severity: medium Keywords: DownloadManager SEGV
Cc: Ticket locked: no

Description

  1. Fix a SEGV that can occur if a download times out. If a caller makes a synchronous call then downloadNow will timeout after 10 seconds but downloadFinished, which is a slot, can be called after control has returned to the caller and the QByteArray data buffer has been deallocated.
  1. Allow the caller to set their own User-Agent header.
  1. Provide better error reporting.

Attachments (1)

0001-DownloadManager-Fix-SEGV-after-timeout.patch (3.9 KB) - added by Lawrence Rust <lvr@…> 7 years ago.

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by Lawrence Rust <lvr@…>

comment:1 Changed 7 years ago by cpinkham

Owner: set to cpinkham
Status: newassigned

comment:2 Changed 7 years ago by Github

Improvements to MythDownloadManager? error reporting.

Refs #9950

Signed-off-by: Chris Pinkham <cpinkham@…>

Branch: master Changeset: 1e235ebb2724d347e12d752e0befa7f6773ad0e3

comment:3 Changed 7 years ago by Github

Milestone: unknown0.25
Resolution: fixed
Status: assignedclosed

Fix a potential segfault if MDM::downloadNow() times out.

Reset the destination QByteArray pointer after a download timeout to make sure the downloadFinished() callback doesn't try to write to it after it has been deallocated.

Closes #9950

I'm leaving part 2 of #9950 uncommitted for now since we do not need or use this functionality internally.

Signed-off-by: Chris Pinkham <cpinkham@…>

Branch: master Changeset: db25a2885364d4d1b2198056f7a477f60cb395d6

comment:4 Changed 7 years ago by Lawrence Rust <lvr@…>

Part 2 is of interest for implementing MHEG InteractionChannel? i.e. BBC iPlayer functionality. The spec mandates that the client set the User-Agent to a specific form. That said, there are a number of other chages to do with cache querying that would be required too.

comment:5 Changed 7 years ago by cpinkham

When you have the MHEG InterationChannel? patch ready, you can resubmit the User-Agent change to MythDownloadManager? with it and we can apply that functionality along with the code that uses it at the same time.

Note: See TracTickets for help on using tickets.