Skip to content

[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

Merged
merged 2 commits into from
Feb 23, 2017
Merged

[gardening]Remove commented code from URLSession #884

merged 2 commits into from
Feb 23, 2017

Conversation

nethraravindran
Copy link
Contributor

No description provided.

@pushkarnk pushkarnk changed the title Gardening work for NSURLSession [gardening]Remove commented code from URLSession Feb 17, 2017
// // 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()
//}
Copy link
Member

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 ..

Copy link
Contributor Author

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
Copy link
Member

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()
//}
}
Copy link
Member

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
Copy link
Member

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_

root and others added 2 commits February 23, 2017 14:46
Copy link
Contributor Author

@nethraravindran nethraravindran left a 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()
//}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed suggested changes.

@nethraravindran
Copy link
Contributor Author

Cleaned up the commented code and addressed the changes

@pushkarnk
Copy link
Member

@swift-ci please test and merge

1 similar comment
@pushkarnk
Copy link
Member

@swift-ci please test and merge

@swift-ci swift-ci merged commit e3f514d into swiftlang:master Feb 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants