Skip to content
  • Andrew Gregory's avatar
    dload: ensure callback is always initialized once · 59bb21fc
    Andrew Gregory authored and Allan McRae's avatar Allan McRae committed
    
    
    Frontends rely on an initialization call for setup between downloads.
    Checking for intialization after checking for a completed download can
    skip initialization in cases where files are small enough to be
    downloaded all at once (FS#56408).  Relying on previous download size
    can result in multiple initializations if there are multiple
    non-transfer events prior to the download starting (fS#56468).
    
    Introduce a new cb_initialized variable to the payload struct and use it
    to ensure that the callback is initialized exactly once prior to any
    actual events.
    
    Fixes FS#56408, FS#56468
    
    Signed-off-by: default avatarAndrew Gregory <andrew.gregory.8@gmail.com>
    Signed-off-by: default avatarAllan McRae <allan@archlinux.org>
    59bb21fc