mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-23 16:13:46 +00:00
Merge pull request #499 from Mygod/battery-opt
Reduce battery usage - transmit traffic stat with binary
This commit is contained in:
+2
-4
@@ -121,11 +121,9 @@ int send_traffic_stat(uint64_t tx, uint64_t rx)
|
||||
return -1;
|
||||
}
|
||||
|
||||
char stat[256] = { 0 };
|
||||
snprintf(stat, 256, "%llu|%llu", tx, rx);
|
||||
size_t len = strlen(stat);
|
||||
uint64_t stat[2] = { tx, rx };
|
||||
|
||||
if (send(sock, stat, len, 0) == -1) {
|
||||
if (send(sock, stat, sizeof(stat), 0) == -1) {
|
||||
ERROR("[android] send");
|
||||
close(sock);
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user