Skip to content

Commit 34d6273

Browse files
author
Qiming Yuan
committed
Fix dead lock issue for DropboxOauth2Helper.
1 parent 6d4f734 commit 34d6273

File tree

285 files changed

+1322
-1323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

285 files changed

+1322
-1323
lines changed

Dropbox.Api/AppProperties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
[assembly: AssemblyCulture("")]
1919

2020
[assembly: AssemblyVersion("4.0.0")]
21-
[assembly: AssemblyFileVersion("4.0.6291")]
21+
[assembly: AssemblyFileVersion("4.0.6321")]

Dropbox.Api/Dropbox.Api.nuspec

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package>
33
<metadata>
44
<id>Dropbox.Api</id>
5-
<version>4.2.4</version>
5+
<version>4.2.5</version>
66
<title>Dropbox v2 API</title>
77
<authors>Dropbox Inc</authors>
88
<owners>Dropbox Inc</owners>
@@ -12,9 +12,8 @@
1212
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1313
<description>Portable class library for accessing the Dropbox v2 API</description>
1414
<releaseNotes>
15-
What's new:
16-
- Update DropboxOauth2Helper to use versionless oauth2 endpoints.
17-
- Use semantic versioning for AssemblyInfo.cs.
15+
Bug fixes:
16+
- Fixed deadlock issue for DropboxOauth2Helper.
1817
</releaseNotes>
1918
<copyright>Copyright (c) Dropbox Inc. 2016</copyright>
2019
<tags>Dropbox Api</tags>
@@ -40,4 +39,4 @@ What's new:
4039
<file src="bin\Release\portable40\Dropbox.Api.dll" target="lib\portable-net40+sl5+wp80+win8+wpa81\Dropbox.Api.dll" />
4140
<file src="bin\Release\portable40\Dropbox.Api.xml" target="lib\portable-net40+sl5+wp80+win8+wpa81\Dropbox.Api.xml" />
4241
</files>
43-
</package>
42+
</package>

Dropbox.Api/DropboxOauth2Helper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,9 @@ public static async Task<OAuth2Response> ProcessCodeFlowAsync(string code, strin
372372
}
373373

374374
var content = new FormUrlEncodedContent(parameters);
375-
var response = await httpClient.PostAsync("https://api.dropbox.com/oauth2/token", content);
375+
var response = await httpClient.PostAsync("https://api.dropbox.com/oauth2/token", content).ConfigureAwait(false);
376376

377-
var raw = await response.Content.ReadAsStringAsync();
377+
var raw = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
378378
var json = JObject.Parse(raw);
379379

380380
if (response.StatusCode != HttpStatusCode.OK)

Dropbox.Api/Generated/Auth/AccessError.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ private class InvalidAccountTypeEncoder : enc.StructEncoder<InvalidAccountType>
230230
/// <param name="writer">The writer.</param>
231231
public override void EncodeFields(InvalidAccountType value, enc.IJsonWriter writer)
232232
{
233-
Dropbox.Api.Auth.InvalidAccountTypeError.Encoder.EncodeFields(value.Value, writer);
233+
global::Dropbox.Api.Auth.InvalidAccountTypeError.Encoder.EncodeFields(value.Value, writer);
234234
}
235235
}
236236

@@ -264,7 +264,7 @@ protected override void SetField(InvalidAccountType value, string fieldName, enc
264264
switch (fieldName)
265265
{
266266
case "invalid_account_type":
267-
value.Value = Dropbox.Api.Auth.InvalidAccountTypeError.Decoder.Decode(reader);
267+
value.Value = global::Dropbox.Api.Auth.InvalidAccountTypeError.Decoder.Decode(reader);
268268
break;
269269
default:
270270
reader.Skip();
@@ -329,7 +329,7 @@ private class PaperAccessDeniedEncoder : enc.StructEncoder<PaperAccessDenied>
329329
/// <param name="writer">The writer.</param>
330330
public override void EncodeFields(PaperAccessDenied value, enc.IJsonWriter writer)
331331
{
332-
Dropbox.Api.Auth.PaperAccessError.Encoder.EncodeFields(value.Value, writer);
332+
global::Dropbox.Api.Auth.PaperAccessError.Encoder.EncodeFields(value.Value, writer);
333333
}
334334
}
335335

@@ -363,7 +363,7 @@ protected override void SetField(PaperAccessDenied value, string fieldName, enc.
363363
switch (fieldName)
364364
{
365365
case "paper_access_denied":
366-
value.Value = Dropbox.Api.Auth.PaperAccessError.Decoder.Decode(reader);
366+
value.Value = global::Dropbox.Api.Auth.PaperAccessError.Decoder.Decode(reader);
367367
break;
368368
default:
369369
reader.Skip();

Dropbox.Api/Generated/Auth/AuthAppRoutes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ internal AuthAppRoutes(enc.ITransport transport)
4141
/// cref="TokenFromOAuth1Error"/>.</exception>
4242
public t.Task<TokenFromOAuth1Result> TokenFromOauth1Async(TokenFromOAuth1Arg tokenFromOAuth1Arg)
4343
{
44-
return this.Transport.SendRpcRequestAsync<TokenFromOAuth1Arg, TokenFromOAuth1Result, TokenFromOAuth1Error>(tokenFromOAuth1Arg, "api", "/auth/token/from_oauth1", "app", Dropbox.Api.Auth.TokenFromOAuth1Arg.Encoder, Dropbox.Api.Auth.TokenFromOAuth1Result.Decoder, Dropbox.Api.Auth.TokenFromOAuth1Error.Decoder);
44+
return this.Transport.SendRpcRequestAsync<TokenFromOAuth1Arg, TokenFromOAuth1Result, TokenFromOAuth1Error>(tokenFromOAuth1Arg, "api", "/auth/token/from_oauth1", "app", global::Dropbox.Api.Auth.TokenFromOAuth1Arg.Encoder, global::Dropbox.Api.Auth.TokenFromOAuth1Result.Decoder, global::Dropbox.Api.Auth.TokenFromOAuth1Error.Decoder);
4545
}
4646

4747
/// <summary>

Dropbox.Api/Generated/Auth/RateLimitError.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private class RateLimitErrorEncoder : enc.StructEncoder<RateLimitError>
8181
/// <param name="writer">The writer.</param>
8282
public override void EncodeFields(RateLimitError value, enc.IJsonWriter writer)
8383
{
84-
WriteProperty("reason", value.Reason, writer, Dropbox.Api.Auth.RateLimitReason.Encoder);
84+
WriteProperty("reason", value.Reason, writer, global::Dropbox.Api.Auth.RateLimitReason.Encoder);
8585
WriteProperty("retry_after", value.RetryAfter, writer, enc.UInt64Encoder.Instance);
8686
}
8787
}
@@ -116,7 +116,7 @@ protected override void SetField(RateLimitError value, string fieldName, enc.IJs
116116
switch (fieldName)
117117
{
118118
case "reason":
119-
value.Reason = Dropbox.Api.Auth.RateLimitReason.Decoder.Decode(reader);
119+
value.Reason = global::Dropbox.Api.Auth.RateLimitReason.Decoder.Decode(reader);
120120
break;
121121
case "retry_after":
122122
value.RetryAfter = enc.UInt64Decoder.Instance.Decode(reader);

Dropbox.Api/Generated/Files/AlphaGetMetadataArg.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Dropbox.Api.Files
1313
/// <summary>
1414
/// <para>The alpha get metadata arg object</para>
1515
/// </summary>
16-
/// <seealso cref="Dropbox.Api.Files.GetMetadataArg" />
16+
/// <seealso cref="Global::Dropbox.Api.Files.GetMetadataArg" />
1717
public class AlphaGetMetadataArg : GetMetadataArg
1818
{
1919
#pragma warning disable 108

Dropbox.Api/Generated/Files/AlphaGetMetadataError.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ private class PropertiesErrorEncoder : enc.StructEncoder<PropertiesError>
203203
/// <param name="writer">The writer.</param>
204204
public override void EncodeFields(PropertiesError value, enc.IJsonWriter writer)
205205
{
206-
Dropbox.Api.Files.LookUpPropertiesError.Encoder.EncodeFields(value.Value, writer);
206+
global::Dropbox.Api.Files.LookUpPropertiesError.Encoder.EncodeFields(value.Value, writer);
207207
}
208208
}
209209

@@ -236,7 +236,7 @@ protected override void SetField(PropertiesError value, string fieldName, enc.IJ
236236
switch (fieldName)
237237
{
238238
case "properties_error":
239-
value.Value = Dropbox.Api.Files.LookUpPropertiesError.Decoder.Decode(reader);
239+
value.Value = global::Dropbox.Api.Files.LookUpPropertiesError.Decoder.Decode(reader);
240240
break;
241241
default:
242242
reader.Skip();
@@ -299,7 +299,7 @@ private class PathEncoder : enc.StructEncoder<Path>
299299
/// <param name="writer">The writer.</param>
300300
public override void EncodeFields(Path value, enc.IJsonWriter writer)
301301
{
302-
Dropbox.Api.Files.LookupError.Encoder.EncodeFields(value.Value, writer);
302+
global::Dropbox.Api.Files.LookupError.Encoder.EncodeFields(value.Value, writer);
303303
}
304304
}
305305

@@ -332,7 +332,7 @@ protected override void SetField(Path value, string fieldName, enc.IJsonReader r
332332
switch (fieldName)
333333
{
334334
case "path":
335-
value.Value = Dropbox.Api.Files.LookupError.Decoder.Decode(reader);
335+
value.Value = global::Dropbox.Api.Files.LookupError.Decoder.Decode(reader);
336336
break;
337337
default:
338338
reader.Skip();

Dropbox.Api/Generated/Files/CommitInfo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public CommitInfo(string path,
6363

6464
if (mode == null)
6565
{
66-
mode = Dropbox.Api.Files.WriteMode.Add.Instance;
66+
mode = global::Dropbox.Api.Files.WriteMode.Add.Instance;
6767
}
6868
this.Path = path;
6969
this.Mode = mode;
@@ -80,7 +80,7 @@ public CommitInfo(string path,
8080
[sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)]
8181
public CommitInfo()
8282
{
83-
this.Mode = Dropbox.Api.Files.WriteMode.Add.Instance;
83+
this.Mode = global::Dropbox.Api.Files.WriteMode.Add.Instance;
8484
this.Autorename = false;
8585
this.Mute = false;
8686
}
@@ -132,7 +132,7 @@ private class CommitInfoEncoder : enc.StructEncoder<CommitInfo>
132132
public override void EncodeFields(CommitInfo value, enc.IJsonWriter writer)
133133
{
134134
WriteProperty("path", value.Path, writer, enc.StringEncoder.Instance);
135-
WriteProperty("mode", value.Mode, writer, Dropbox.Api.Files.WriteMode.Encoder);
135+
WriteProperty("mode", value.Mode, writer, global::Dropbox.Api.Files.WriteMode.Encoder);
136136
WriteProperty("autorename", value.Autorename, writer, enc.BooleanEncoder.Instance);
137137
if (value.ClientModified != null)
138138
{
@@ -175,7 +175,7 @@ protected override void SetField(CommitInfo value, string fieldName, enc.IJsonRe
175175
value.Path = enc.StringDecoder.Instance.Decode(reader);
176176
break;
177177
case "mode":
178-
value.Mode = Dropbox.Api.Files.WriteMode.Decoder.Decode(reader);
178+
value.Mode = global::Dropbox.Api.Files.WriteMode.Decoder.Decode(reader);
179179
break;
180180
case "autorename":
181181
value.Autorename = enc.BooleanDecoder.Instance.Decode(reader);

Dropbox.Api/Generated/Files/CommitInfoWithProperties.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Dropbox.Api.Files
1313
/// <summary>
1414
/// <para>The commit info with properties object</para>
1515
/// </summary>
16-
/// <seealso cref="Dropbox.Api.Files.CommitInfo" />
16+
/// <seealso cref="Global::Dropbox.Api.Files.CommitInfo" />
1717
public class CommitInfoWithProperties : CommitInfo
1818
{
1919
#pragma warning disable 108
@@ -52,7 +52,7 @@ public CommitInfoWithProperties(string path,
5252
bool autorename = false,
5353
sys.DateTime? clientModified = null,
5454
bool mute = false,
55-
col.IEnumerable<Dropbox.Api.Properties.PropertyGroup> propertyGroups = null)
55+
col.IEnumerable<global::Dropbox.Api.Properties.PropertyGroup> propertyGroups = null)
5656
: base(path, mode, autorename, clientModified, mute)
5757
{
5858
var propertyGroupsList = enc.Util.ToList(propertyGroups);
@@ -74,7 +74,7 @@ public CommitInfoWithProperties()
7474
/// <summary>
7575
/// <para>List of custom properties to add to file.</para>
7676
/// </summary>
77-
public col.IList<Dropbox.Api.Properties.PropertyGroup> PropertyGroups { get; protected set; }
77+
public col.IList<global::Dropbox.Api.Properties.PropertyGroup> PropertyGroups { get; protected set; }
7878

7979
#region Encoder class
8080

@@ -91,7 +91,7 @@ private class CommitInfoWithPropertiesEncoder : enc.StructEncoder<CommitInfoWith
9191
public override void EncodeFields(CommitInfoWithProperties value, enc.IJsonWriter writer)
9292
{
9393
WriteProperty("path", value.Path, writer, enc.StringEncoder.Instance);
94-
WriteProperty("mode", value.Mode, writer, Dropbox.Api.Files.WriteMode.Encoder);
94+
WriteProperty("mode", value.Mode, writer, global::Dropbox.Api.Files.WriteMode.Encoder);
9595
WriteProperty("autorename", value.Autorename, writer, enc.BooleanEncoder.Instance);
9696
if (value.ClientModified != null)
9797
{
@@ -100,7 +100,7 @@ public override void EncodeFields(CommitInfoWithProperties value, enc.IJsonWrite
100100
WriteProperty("mute", value.Mute, writer, enc.BooleanEncoder.Instance);
101101
if (value.PropertyGroups.Count > 0)
102102
{
103-
WriteListProperty("property_groups", value.PropertyGroups, writer, Dropbox.Api.Properties.PropertyGroup.Encoder);
103+
WriteListProperty("property_groups", value.PropertyGroups, writer, global::Dropbox.Api.Properties.PropertyGroup.Encoder);
104104
}
105105
}
106106
}
@@ -139,7 +139,7 @@ protected override void SetField(CommitInfoWithProperties value, string fieldNam
139139
value.Path = enc.StringDecoder.Instance.Decode(reader);
140140
break;
141141
case "mode":
142-
value.Mode = Dropbox.Api.Files.WriteMode.Decoder.Decode(reader);
142+
value.Mode = global::Dropbox.Api.Files.WriteMode.Decoder.Decode(reader);
143143
break;
144144
case "autorename":
145145
value.Autorename = enc.BooleanDecoder.Instance.Decode(reader);
@@ -151,7 +151,7 @@ protected override void SetField(CommitInfoWithProperties value, string fieldNam
151151
value.Mute = enc.BooleanDecoder.Instance.Decode(reader);
152152
break;
153153
case "property_groups":
154-
value.PropertyGroups = ReadList<Dropbox.Api.Properties.PropertyGroup>(reader, Dropbox.Api.Properties.PropertyGroup.Decoder);
154+
value.PropertyGroups = ReadList<global::Dropbox.Api.Properties.PropertyGroup>(reader, global::Dropbox.Api.Properties.PropertyGroup.Decoder);
155155
break;
156156
default:
157157
reader.Skip();

0 commit comments

Comments
 (0)