Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a2a1914 authored by bigbiff bigbiff's avatar bigbiff bigbiff Committed by Dees Troy
Browse files

adbbackup: write smaller reads less than 512 bytes

This will allow the gzip compression header to be
written properly to the adb stream.

Thanks to nkk71 for finding the issue.
Change-Id: I3d88c5f575ca3fac904d8279f1f246994be2b02f
parent 05c2de4c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -330,7 +330,7 @@ int twrpback::backup(std::string command) {
		//to the adb stream.
		//to the adb stream.
		//If the stream is compressed, we need to always write the data.
		//If the stream is compressed, we need to always write the data.
		if (writedata || compressed) {
		if (writedata || compressed) {
			while ((bytes = read(adb_read_fd, &result, sizeof(result))) == MAX_ADB_READ) {
			while ((bytes = read(adb_read_fd, &result, sizeof(result))) > 0) {
				if (firstDataPacket) {
				if (firstDataPacket) {
					struct AdbBackupControlType data_block;
					struct AdbBackupControlType data_block;