Skip to content

Commit

Permalink
Merge branch 'master' into feature/default-option
Browse files Browse the repository at this point in the history
# Conflicts:
#	Sources/ImageDownloader.swift
  • Loading branch information
onevcat committed May 11, 2017
2 parents 6e25f40 + df98933 commit 87e64da
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Sources/ImageDownloader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ open class ImageDownloader {
}

/// Whether the download requests should use pipeling or not. Default is false.
open var requestsUsePipeling = false
open var requestsUsePipelining = false

fileprivate let sessionHandler: ImageDownloaderSessionHandler
fileprivate var session: URLSession?
Expand Down Expand Up @@ -282,8 +282,8 @@ open class ImageDownloader {

// We need to set the URL as the load key. So before setup progress, we need to ask the `requestModifier` for a final URL.
var request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData, timeoutInterval: timeout)
request.httpShouldUsePipelining = requestsUsePipeling
request.httpShouldUsePipelining = requestsUsePipelining

if let modifier = options?.modifier {
guard let r = modifier.modified(for: request) else {
completionHandler?(nil, NSError(domain: KingfisherErrorDomain, code: KingfisherError.downloadCancelledBeforeStarting.rawValue, userInfo: nil), nil, nil)
Expand Down Expand Up @@ -531,3 +531,12 @@ class ImageDownloaderSessionHandler: NSObject, URLSessionDataDelegate, Authentic

// Placeholder. For retrieving extension methods of ImageDownloaderDelegate
extension ImageDownloader: ImageDownloaderDelegate {}

// MARK: - Deprecated
extension ImageDownloader {
@available(*, deprecated, message: "`requestsUsePipeling` is deprecated. Use `requestsUsePipelining` instead", renamed: "requestsUsePipelining")
open var requestsUsePipeling: Bool {
get { return requestsUsePipelining }
set { requestsUsePipelining = newValue }
}
}

0 comments on commit 87e64da

Please sign in to comment.