|
|
@ -45,6 +45,8 @@ |
|
|
|
#include "netutils.h" |
|
|
|
#include "utils.h" |
|
|
|
|
|
|
|
extern char *prefix; |
|
|
|
|
|
|
|
int protect_socket(int fd) |
|
|
|
{ |
|
|
|
int sock; |
|
|
@ -62,7 +64,8 @@ int protect_socket(int fd) |
|
|
|
setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval)); |
|
|
|
setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(struct timeval)); |
|
|
|
|
|
|
|
const char path[] = "/data/data/com.github.shadowsocks/protect_path"; |
|
|
|
char path[256]; |
|
|
|
sprintf(path, "%s/protect_path", prefix); |
|
|
|
|
|
|
|
memset(&addr, 0, sizeof(addr)); |
|
|
|
addr.sun_family = AF_UNIX; |
|
|
@ -109,7 +112,8 @@ int send_traffic_stat(uint64_t tx, uint64_t rx) |
|
|
|
setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval)); |
|
|
|
setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(struct timeval)); |
|
|
|
|
|
|
|
const char path[] = "/data/data/com.github.shadowsocks/stat_path"; |
|
|
|
char path[256]; |
|
|
|
sprintf(path, "%s/protect_path", prefix); |
|
|
|
|
|
|
|
memset(&addr, 0, sizeof(addr)); |
|
|
|
addr.sun_family = AF_UNIX; |
|
|
|