Skip to content

Commit a872a8e

Browse files
authored
Add explicit buffering options (Azure#19115)
1 parent 748041d commit a872a8e

File tree

7 files changed

+38
-2
lines changed

7 files changed

+38
-2
lines changed

sdk/storage/Azure.Storage.Blobs.Batch/src/ContainerRestClient.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ internal HttpMessage CreateSubmitBatchRequest(string containerName, long content
1515
{
1616
var message = _pipeline.CreateMessage();
1717
var request = message.Request;
18-
message.BufferResponse = false;
1918
request.Method = RequestMethod.Post;
2019
var uri = new RawRequestUriBuilder();
2120
uri.AppendRaw(url, false);

sdk/storage/Azure.Storage.Blobs.Batch/src/autorest.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,13 @@ directive:
205205
transform: >
206206
$.Blob["x-ms-skip-url-encoding"] = true;
207207
$.ContainerName["x-ms-skip-url-encoding"] = true;
208+
```
209+
210+
### Buffer batch responses
211+
212+
``` yaml
213+
directive:
214+
- from: swagger-document
215+
where: $..[?(@.operationId=='Service_SubmitBatch' || @.operationId=='Container_SubmitBatch')]
216+
transform: $["x-csharp-buffer-response"] = true;
208217
```

sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ private async Task<Response<BlobDownloadInfo>> StartDownloadAsync(
10061006
}
10071007

10081008
// Watch out for exploding Responses
1009-
long length = response.IsUnavailable() ? 0 : response.Value.Length;
1009+
long length = response.IsUnavailable() ? 0 : response.Headers.ContentLength ?? 0;
10101010
ClientConfiguration.Pipeline.LogTrace($"Response: {response.GetRawResponse().Status}, ContentLength: {length}");
10111011

10121012
return Response.FromValue(

sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/storage/Azure.Storage.Blobs/src/autorest.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,4 +276,13 @@ directive:
276276
"x-az-response-name": "ConditionNotMetError",
277277
"headers": { "x-ms-error-code": { "x-ms-client-name": "ErrorCode", "type": "string" } }
278278
};
279+
```
280+
281+
### Don't buffer downloads and query
282+
283+
``` yaml
284+
directive:
285+
- from: swagger-document
286+
where: $..[?(@.operationId=='Blob_Query' || @.operationId=='Blob_Download')]
287+
transform: $["x-csharp-buffer-response"] = false;
279288
```

sdk/storage/Azure.Storage.Files.DataLake/src/autorest.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,13 @@ directive:
9090
$.patch.consumes = [
9191
"application/octet-stream"
9292
]
93+
```
94+
95+
### Don't buffer downloads
96+
97+
``` yaml
98+
directive:
99+
- from: swagger-document
100+
where: $..[?(@.operationId=='Path_Read')]
101+
transform: $["x-csharp-buffer-response"] = false;
93102
```

sdk/storage/Azure.Storage.Files.Shares/src/autorest.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,13 @@ directive:
121121
delete $[id];
122122
}
123123
});
124+
```
125+
126+
### Don't buffer downloads
127+
128+
``` yaml
129+
directive:
130+
- from: swagger-document
131+
where: $..[?(@.operationId=='File_Download')]
132+
transform: $["x-csharp-buffer-response"] = false;
124133
```

0 commit comments

Comments
 (0)