Index: utils/ofhttp/OFHTTP.m ================================================================== --- utils/ofhttp/OFHTTP.m +++ utils/ofhttp/OFHTTP.m @@ -49,10 +49,11 @@ #import "OFInvalidServerResponseException.h" #import "OFOpenItemFailedException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFResolveHostFailedException.h" +#import "OFSetItemAttributesFailedException.h" #import "OFUnsupportedProtocolException.h" #import "OFWriteFailedException.h" #import "ProgressBar.h" @@ -965,10 +966,26 @@ @"exception", e)]; _errorCode = 1; goto next; } + +#ifdef OF_LINUX + @try { + OFString *IRIString = request.IRI.string; + OFData *downloadedFromData = [OFData + dataWithItems: IRIString.UTF8String + count: IRIString.UTF8StringLength + 1]; + [[OFFileManager defaultManager] + setExtendedAttributeData: downloadedFromData + forName: @"user.ofhttp." + @"downloaded_from" + ofItemAtPath: _currentFileName]; + } @catch (OFSetItemAttributesFailedException *) { + /* Ignore */ + } +#endif #ifdef OF_MACOS @try { OFString *quarantine = [OFString stringWithFormat: @"0000;%08" @PRIx64 @";ofhttp;", @@ -978,11 +995,11 @@ count: quarantine.UTF8StringLength]; [[OFFileManager defaultManager] setExtendedAttributeData: quarantineData forName: @"com.apple.quarantine" ofItemAtPath: _currentFileName]; - } @catch (OFGetItemAttributesFailedException *e) { + } @catch (OFSetItemAttributesFailedException *e) { /* Ignore */ } #endif }