Skip to content
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

Timob 9797: Android: HTTP Post will save a photo at Internal phone storage #2498

Merged
merged 8 commits into from Jul 10, 2012

Conversation

pingwang2011
Copy link
Contributor

https://jira.appcelerator.org/browse/TIMOB-9797
For functional test, please run the two test cases in JIRA. And run KS->Platform->XHR->UTF-8+GET/POST, KS->Mashups and drillbit-> network/network.httpclient for a sanity check.

@@ -1013,6 +1015,8 @@ protected DefaultHttpClient getClient(boolean validating)

public void send(Object userData) throws MethodNotSupportedException
{
ArrayList<File> tmpFiles = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason this can't just be a private variable of the class versus passing it around as a function arguments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Temporary files are generated in send(). We may have only one http client but call send() many times.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah but it isn't valid to call send() multiple times when a request is in progress.
We should have deleted and cleared out the temporary files by the time the request finishes right?

@pingwang2011
Copy link
Contributor Author

Updated. Ready for review again.

}
if (tmpFiles != null) {
tmpFiles.clear();
tmpFiles = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

How about we just test if tmpFiles is null OR empty. If this is true then just return.
Otherwise iterate through the files and delete each one. Once this loop is done
just null out tmpFiles (we don't need to clear since it will get GC'ed).

@joshthecoder
Copy link
Contributor

Code reviewed and functional tested. Accepted

joshthecoder added a commit that referenced this pull request Jul 10, 2012
Timob 9797: Android: HTTP Post will save a photo at Internal phone storage
@joshthecoder joshthecoder merged commit 2f2b552 into tidev:master Jul 10, 2012
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.

None yet

2 participants