Commit 03d31865 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Transfer URIs instead of platform-dependent file paths (#8701)

parent 34ed3d2d
6e54f5e31f084d2e54a510959f68b89e4d2fdffd e0c702e35300b7fdef975b9929df25e112fa9eda
...@@ -199,8 +199,7 @@ class ServiceProtocolDevFSOperations implements DevFSOperations { ...@@ -199,8 +199,7 @@ class ServiceProtocolDevFSOperations implements DevFSOperations {
'_writeDevFSFile', '_writeDevFSFile',
params: <String, dynamic> { params: <String, dynamic> {
'fsName': fsName, 'fsName': fsName,
// TODO(goderbauer): transfer real Uri (instead of file path) when remote end supports it 'uri': deviceUri.toString(),
'path': deviceUri.toFilePath(windows: false),
'fileContents': fileContents 'fileContents': fileContents
}, },
); );
...@@ -268,9 +267,8 @@ class _DevFSHttpWriter { ...@@ -268,9 +267,8 @@ class _DevFSHttpWriter {
final HttpClientRequest request = await _client.putUrl(httpAddress); final HttpClientRequest request = await _client.putUrl(httpAddress);
request.headers.removeAll(HttpHeaders.ACCEPT_ENCODING); request.headers.removeAll(HttpHeaders.ACCEPT_ENCODING);
request.headers.add('dev_fs_name', fsName); request.headers.add('dev_fs_name', fsName);
// TODO(goderbauer): transfer real Uri (instead of file path) when remote end supports it request.headers.add('dev_fs_uri_b64',
request.headers.add('dev_fs_path_b64', BASE64.encode(UTF8.encode(deviceUri.toString())));
BASE64.encode(UTF8.encode(deviceUri.toFilePath(windows: false))));
final Stream<List<int>> contents = content.contentsAsCompressedStream(); final Stream<List<int>> contents = content.contentsAsCompressedStream();
await request.addStream(contents); await request.addStream(contents);
final HttpClientResponse response = await request.close(); final HttpClientResponse response = await request.close();
......
...@@ -299,7 +299,7 @@ class MockVMService extends BasicMock implements VMService { ...@@ -299,7 +299,7 @@ class MockVMService extends BasicMock implements VMService {
_httpAddress = Uri.parse('http://127.0.0.1:${_server.port}'); _httpAddress = Uri.parse('http://127.0.0.1:${_server.port}');
_server.listen((HttpRequest request) { _server.listen((HttpRequest request) {
final String fsName = request.headers.value('dev_fs_name'); final String fsName = request.headers.value('dev_fs_name');
final String devicePath = UTF8.decode(BASE64.decode(request.headers.value('dev_fs_path_b64'))); final String devicePath = UTF8.decode(BASE64.decode(request.headers.value('dev_fs_uri_b64')));
messages.add('writeFile $fsName $devicePath'); messages.add('writeFile $fsName $devicePath');
request.drain<List<int>>().then<Null>((List<int> value) { request.drain<List<int>>().then<Null>((List<int> value) {
request.response request.response
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment