Still trying to NuGet push working on Mono (see https://github.com/NuGet/Home/issues/3251#issuecomment-278543504)
With https://github.com/mono/mono/commit/4393b684526a78da6b9d5d45b82758e23676da57 in, the push operation works under those two scenarios:
- Pushing a small package (2.6K)
- Pushing any package when routing via an http proxy (Charles)
However, when I try to push a more consequent package (5.4M) I get this kind of transaction (logging added to main NuGet binary): https://gist.github.com/garuma/e75dc824c57435990b88c0004d4e2e82
It *seems* that somehow when pushing the bigger package, something is writing to the socket after the initial request has been refused by the server which triggers a 400 Bad Request because it can't recognize the verb used indicating possible corruption.
Based on a suggestion from Ludovic, I changed the code to request the HTTP connection to be closed after an exchange and now I get an ObjectDisposedException exception in the transaction: https://gist.github.com/garuma/bcea2ac128e4687e42ffaf7cc8f3d509
This exception make it looks like the content stream copying that is occurring in https://github.com/mono/mono/blob/master/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs#L379 is not taking the lifetime of the http conversation into account and continue writing to the underlying socket which, in this case, ends up throwing an ODE because of it.
We'd need some sort of repro as that code is quite complicated
See also https://bugzilla.xamarin.com/show_bug.cgi?id=44027, which has a repro.