Skip to content

Fix for URLSession redirect does not inherit request timeout value[SR… #1063

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 1 commit into from
Jun 27, 2017

Conversation

saiHemak
Copy link
Contributor

…-2682]

@bubski
Copy link
Contributor

bubski commented Jun 23, 2017

@saiHemak does this maybe fix problems with TestURLSession.test_httpRedirection?

@pushkarnk
Copy link
Member

@saiHemak #1062 changed TestURLSession to using a single server. We'd need to change the test here accordingly.

}
}

func getTimetaken() -> Double {
Copy link
Contributor

Choose a reason for hiding this comment

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

Spelling: should be getTimeTaken().

}

func getTimetaken() -> Double {
let timeTaken = UnsafeMutablePointer<Double>.allocate(capacity: 8)
Copy link
Contributor

@xwu xwu Jun 25, 2017

Choose a reason for hiding this comment

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

This is not correct. You are allocating 8 instances of type Double. The body of this function should be:

var timeSpent = Double()
CFURLSession_easy_getinfo_double(rawHandle, CFURLSessionInfoTOTAL_TIME,  &timeSpent)
return timeSpent

Since this is used only for subtracting from the timeout interval, it might be worthwhile to return timeSpent / 1000 and to rename this function getTimeoutIntervalSpent().

@saiHemak saiHemak force-pushed the nsredirect branch 2 times, most recently from 3a7cb8f to 731498c Compare June 27, 2017 05:38
@pushkarnk
Copy link
Member

@swift-ci please test

1 similar comment
@pushkarnk
Copy link
Member

@swift-ci please test

@saiHemak
Copy link
Contributor Author

saiHemak commented Jun 27, 2017

@bubski I could see the test case TestURLSession.test_httpRedirection is passing successfully even without this change. .Can you please elaborate about the issue you are facing ?
@pushkarnk ,@xwu : Thanks for the review.I have addressed your review comments.

@bubski
Copy link
Contributor

bubski commented Jun 27, 2017

@saiHemak I pulled newest changes and the problem went away.

@pushkarnk
Copy link
Member

Thanks @saiHemak

@swift-ci test and merge

@pushkarnk
Copy link
Member

@swift-ci test and merge

@swift-ci swift-ci merged commit c20eec8 into swiftlang:master Jun 27, 2017
@saiHemak saiHemak deleted the nsredirect branch July 20, 2017 09:49
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.

5 participants