-
Notifications
You must be signed in to change notification settings - Fork 564
AndroidClientHandler handling request content #92
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
Conversation
|
Hi @danielcaceresm, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! TTYL, DNFBOT; |
|
@danielcaceresm, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
| HttpURLConnection httpConnection = await SetupRequestInternal (request, java_connection).ConfigureAwait (false); | ||
| return await ProcessRequest (request, httpConnection, cancellationToken); | ||
| var java_url = new URL (request.RequestUri.ToString ()); | ||
| var java_connection = java_url.OpenConnection (); |
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.
Please use the full type instead of var here - it helps when viewing the code from outside an IDE
|
@danielcaceresm please squash all the commits into one, thanks! |
One public method in AndroidClientHandler was modified and one public constructor removed from AndroidHttpResponseMessage. Putting them back requires restoring some of the previous async internal calls.
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=44530 Basically this is part of the problems reported at https://bugzilla.xamarin.com/show_bug.cgi?id=44263 In good old jar2xml era, we marked "obfuscated" types at jar2xml so that those types are not generated in the API XML. class-parse is not that clever and generates everything as is. We could make changes to api-xml-adjuster to bring back sanity, but instead of doing it in jar2xml, we had better bring in flexibility to obfuscation marking. That is - - If there is obfuscated='false' attribute specification by API metadata fixup, then do not mark as obfuscated in any case. - If not, process any lowercase-named types and nested types as obfuscated, such as 'a', 'SomeType$a', or 'SomeType$b$a'. Due to code structures, we cannot take the same code path as jar2xml (we don't hold list of sibling classes when processing an XML element). https://github.com/xamarin/jar2xml/blob/3a7c404/JavaPackage.java#L78 Also, we had seen some obfuscated types like b$a as NOT marked as obfuscated in the past, because we were checking only a,aa,aaa,aaaa and aaaaa as the parent type for nested types. That should be fixed. To fix this issue, we process marking as part of StripNonBindables(). Also, it was too early to register those types to SymbolTable before stripping those types out, so changed relevant processing order. Fixing bug #44263 then exposed another problem; StripNonBindables() was not complete and it was not processing nested C# types at all. Thus we had generated non-bindable code before. This change fixes this issue at the same time, for fixing the bug. Thus, this will result in "API breakage" looking changes in the end, but the bindings were invalid and should be removed without compatibility concern.
These changes are based on the AndroidClientHandler class before the modifications of #44
I think that my changes are simplier, and the commented race condition, doesn't exists.
Other change I've made is to move the connection reference to the response class, this approach is better than holding the last connection in the handler. On the other hand, is pending to implement, dispose the connection if it fails while connecting.