Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#306 closed Enhancement (fixed)

CLI Manual Tracker Update with SIGHUP

Reported by: mtolman Owned by: somebody
Priority: Normal Milestone: 0.90
Component: CLI Version: 0.80
Severity: Normal Keywords:
Cc:

Description

Since the GUI versions can update the trackers manually, I thought it only fair the CLI version should too. I added the following code, and can now trigger a manual update by sending a SIGHUP. If it hasn't been long enough since the last update, the update is delayed until enough time has passed.

static sig_atomic_t  manualUpdate  = 0;
signal( SIGHUP, sigHandler );
if( manualUpdate )
{
    fprintf( stderr, "\rReceived SIGHUP: manual update scheduled\n" );
    manualUpdate = 0;
    tr_manualUpdate( tor );
}
case SIGHUP:
    manualUpdate = 1;
    break;

I know sending a SIGHUP to the process isn't the most user friendly way to trigger the update, but I thought I would share my idea and let you decide how best to proceed.

Attachments (1)

sighup-patch.diff (1.7 KB) - added by tiennou 14 years ago.
Modified the man page accordingly. Added a if (canManualUpdate) so we don't hammer trackers.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 14 years ago by livings124

  • Milestone 0.81 deleted

comment:2 Changed 14 years ago by charles

Could you attach a diff to the version of cli in trunk?

comment:3 Changed 14 years ago by charles

tiennou: could you change this patch to check with tr_torrentCanManualUpdate() and return an error messagei if the manual update is premature, and to also update the man page (transmission.1) to list this feature?

Changed 14 years ago by tiennou

Modified the man page accordingly. Added a if (canManualUpdate) so we don't hammer trackers.

comment:4 Changed 14 years ago by charles

  • Milestone set to 0.90
  • Resolution set to fixed
  • Status changed from new to closed

Committed to trunk in r3467. Thanks for the patch!

comment:5 Changed 14 years ago by charles

  • Component changed from Transmission to CLI
Note: See TracTickets for help on using tickets.