patchmldonkey, a multi-networks file-sharing client - Patches: patch #4649, Environment variables for...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #4649: Environment variables for file_completed_cmd

Submitter:  spiralvoice <spiralvoice>
Submitted:  Wed 23 Nov 2005 12:18:20 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Assigned to:  None
Open/Closed:  Closed

Jump to the original submission

Fri 02 Dec 2005 12:09:02 PM UTC, comment #7: 

applied 2005/12/02

spiralvoice <spiralvoice>
Group administrator
Sat 26 Nov 2005 08:07:42 PM UTC, comment #6: 

"- should environment variables be consistent across all spawned processes? (see: file_start_command)"
there is no problem extending file_start_command, suggestions welcome.

"I assume it currently could move directly to the quarantine from the pre-commit command."
I don´t know if MLDonkey handles this case properly, this means that a finished file is removed from temp before commit. file_commit does lots of important things which could break if the file is removed, but I never tested this case. I am even thinking about removing auto_commit option and commit all finished files immediatly, what about that? There are other problems with finished, but not committed files - BT files don´t upload until they are committed. Now there are two choices, fix this bug in BT or commit all files immediatly. This change should be subject to discussion to know how many users really de-activate auto_commit and why. Pango suggested that users, where incoming and temp are on different partitions, would like to control the diskspace needed for committing files. As MLDonkey will control this itself in the future this would make using
auto_commit false obsolete in this case.

"Is there a problem with having both pre and post commit command options?"
No, unless the filename for the committed file is omitted there because pre-commit command can never provide a 100% correct filename due to name collisions with other files in incoming when commit takes place.

spiralvoice <spiralvoice>
Group administrator
Sat 26 Nov 2005 06:28:49 PM UTC, comment #5: 

- should environment variables be consistent across all spawned processes? (see: file_start_command)

- if a virus checker runs after a completed download has moved to the commit dir, it will potentially be moved twice (once to the commit dir, and then to the quarantine if it fails the check)

I assume it currently could move directly to the quarantine from the pre-commit command.

Is there a problem with having both pre and post commit command options?

z <zet>
Group Member
Sat 26 Nov 2005 04:13:05 PM UTC, comment #4: 

updated patch

  • some log cleaning
  • added information to notification email if auto_commit is disabled, email is sent by file_completed, not file_commit
  • moved execution of !!file_completed_cmd from file_completed

to file_commit, kept option name for easier upgrading
  this was done because the filename of a downloading file can be
  different than the filename of the committed file if a file
  with the same name as the to be committed file is already in
  incoming. older method did not take this into account at all..

  • improved option description, here is a copy:


        (* A command that is called when a file is committed, does not work on MinGW.
            Arguments are (kept for compatability):
              $1 - temp file name, without path
              $2 - file size
              $3 - filename of the committed file
            Also these environment variables can be used (prefered way):
              $TEMPNAME  - temp file name, including path
              $FILEID    - same as $1
              $FILESIZE  - same as $2
              $FILENAME  - same as $3
              $FILEHASH  - internal hash
              $DURATION  - download duration
              $INCOMING  - directory used for commit
              $NETWORK   - network used for downloading
              $ED2K_HASH - ed2k hash if MD4 is known *)
 file_completed_cmd = ""

spiralvoice <spiralvoice>
Group administrator
Thu 24 Nov 2005 01:15:57 AM UTC, comment #3: 

updated patch, see code for new variable names.
please test ed2k_hash variable if it works well

spiralvoice <spiralvoice>
Group administrator
Wed 23 Nov 2005 12:39:33 AM UTC, comment #2: 

eydaimon worked together with pango to create this patch

spiralvoice <spiralvoice>
Group administrator
Wed 23 Nov 2005 12:37:40 AM UTC, comment #1: 

<eydaimon> I'd like to see the original edk link in there too at some point

spiralvoice <spiralvoice>
Group administrator
Wed 23 Nov 2005 12:18:20 AM UTC, original submission:  

patch by Pango:
http://download.berlios.de/pub/mldonkey/pango/file_completed_cmd_env_vars.patch

These variables can be used in the file_completed_cmd scripts:

$FILENAME (temp file name)
$FILEID (file_id = $FILENAME without path)
$FILESIZE
$BESTNAME (real file name)
$INCOMING (directory where file was committed to)
$DURATION

This list can be extended, please post your wishes here.

More information about this feature can be found here:
http://mldonkey.berlios.de/modules.php?name=Wiki&pagename=file_completed_cmd

spiralvoice <spiralvoice>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #4720:  4649_2.patch added by spiralvoice (11KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 10 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-12-02 spiralvoice StatusReady For Test Done
    Open/ClosedOpen Closed
2005-11-26 spiralvoice StatusNone Ready For Test
2005-11-26 spiralvoice Attached File#5511 Removed
2005-11-26 spiralvoice Attached File- Added 4649_2.patch, #5514
2005-11-24 spiralvoice Attached File- Added 4649.patch, #5511
2005-11-24 spiralvoice Attached File#5510 Removed
2005-11-23 spiralvoice Attached File- Added file_completed_cmd_env_vars.patch, #5510
2005-11-23 spiralvoice Attached File#5509 Removed
2005-11-23 spiralvoice Attached File- Added file_completed_cmd_env_vars.patch, #5509

Back to the top

Powered by Savane 3.13-bb6a.
Corresponding source code