-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[gardening]Remove commented code from URLSession #884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gardening]Remove commented code from URLSession #884
Conversation
// // Scale and clamp such that the range 0->1 ends up 1->256 | ||
// let w = 1 + max(0, min(255, Int(round(weight * 255)))) | ||
// try! CFURLSession_easy_setopt_long(rawHandle, CFURLSessionOptionPIPEWAIT, w).asError() | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May make sense to document what the CURLOPT_PIPEWAIT option helps achieve here ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed suggested changes.
//easyHandle.set(waitForPipeliningAndMultiplexing: true) | ||
//easyHandle.set(streamWeight: priority) | ||
//TODO: The CURLOPT_PIPEDWAIT option is unavailable on Ubuntu 14.04 (libcurl 7.36) | ||
//TODO: Introduce something like an #if, if we want to set them here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May make sense to document what the CURLOPT_PIPEWAIT option helps achieve here ..
@@ -167,9 +167,6 @@ extension _EasyHandle { | |||
try! CFURLSession_easy_setopt_long(rawHandle, CFURLSessionOptionPROTOCOLS, protocols).asError() | |||
try! CFURLSession_easy_setopt_long(rawHandle, CFURLSessionOptionREDIR_PROTOCOLS, protocols).asError() | |||
//TODO: Added in libcurl 7.45.0 | |||
// "https".withCString { | |||
// try! CFURLSession_easy_setopt_ptr(rawHandle, CFURLSessionOptionDEFAULT_PROTOCOL, UnsafeMutablePointer($0)).asError() | |||
//} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we document, in a comment, what this code accomplished?
// try! CFURLSession_easy_setopt_ptr(rawHandle, CFURLSessionOptionDEFAULT_PROTOCOL, UnsafeMutablePointer($0)).asError() | ||
//} | ||
//TODO: Set default protocol for schemeless URLs | ||
//CURLOPT_ DEFAULT_PROTOCOL available only in libcurl 7.45.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: please remove the space after CURLOPT_
Changes in TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed the changes
// // Scale and clamp such that the range 0->1 ends up 1->256 | ||
// let w = 1 + max(0, min(255, Int(round(weight * 255)))) | ||
// try! CFURLSession_easy_setopt_long(rawHandle, CFURLSessionOptionPIPEWAIT, w).asError() | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed suggested changes.
Cleaned up the commented code and addressed the changes |
@swift-ci please test and merge |
1 similar comment
@swift-ci please test and merge |
No description provided.