Read the group history response as a stream.

fork-5.53.8
Greyson Parrelli 2021-06-23 17:47:05 -04:00 zatwierdzone przez GitHub
rodzic b3ebf778fd
commit 6502ef64ce
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -2189,7 +2189,7 @@ public class PushServiceSocket {
}
public GroupHistory getGroupsV2GroupHistory(int fromVersion, GroupsV2AuthorizationString authorization)
throws IOException, InvalidProtocolBufferException
throws IOException
{
Response response = makeStorageRequestResponse(authorization.toString(),
String.format(Locale.US, GROUPSV2_GROUP_CHANGES, fromVersion),
@ -2197,7 +2197,16 @@ public class PushServiceSocket {
null,
GROUPS_V2_GET_LOGS_HANDLER);
GroupChanges groupChanges = GroupChanges.parseFrom(readBodyBytes(response.body()));
if (response.body() == null) {
throw new PushNetworkException("No body!");
}
GroupChanges groupChanges;
try {
groupChanges = GroupChanges.parseFrom(response.body().byteStream());
} catch (IOException e) {
throw new PushNetworkException(e);
}
if (response.code() == 206) {
String contentRangeHeader = response.header("Content-Range");