Adjust indentation
This commit is contained in:
parent
24241666fa
commit
45a5d80c49
20
src/client.c
20
src/client.c
|
@ -1458,7 +1458,6 @@ handshake_version(int dns_fd, int *seed)
|
|||
|
||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 'v', 'V', i+1);
|
||||
|
||||
/*XXX START adjust indent 1 tab back*/
|
||||
if (read >= 9) {
|
||||
payload = (((in[4] & 0xff) << 24) |
|
||||
((in[5] & 0xff) << 16) |
|
||||
|
@ -1483,7 +1482,6 @@ handshake_version(int dns_fd, int *seed)
|
|||
}
|
||||
} else if (read > 0)
|
||||
warnx("did not receive proper login challenge");
|
||||
/*XXX END adjust indent 1 tab back*/
|
||||
|
||||
fprintf(stderr, "Retrying version check...\n");
|
||||
}
|
||||
|
@ -1510,7 +1508,6 @@ handshake_login(int dns_fd, int seed)
|
|||
|
||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 'l', 'L', i+1);
|
||||
|
||||
/*XXX START adjust indent 1 tab back*/
|
||||
if (read > 0) {
|
||||
int netmask;
|
||||
if (strncmp("LNAK", in, 4) == 0) {
|
||||
|
@ -1533,7 +1530,6 @@ handshake_login(int dns_fd, int seed)
|
|||
fprintf(stderr, "Received bad handshake\n");
|
||||
}
|
||||
}
|
||||
/*XXX END adjust indent 1 tab back*/
|
||||
|
||||
fprintf(stderr, "Retrying login...\n");
|
||||
}
|
||||
|
@ -1560,7 +1556,6 @@ handshake_raw_udp(int dns_fd, int seed)
|
|||
|
||||
len = handshake_waitdns(dns_fd, in, sizeof(in), 'i', 'I', i+1);
|
||||
|
||||
/*XXX START adjust indent 1 tab back*/
|
||||
if (len == 5 && in[0] == 'I') {
|
||||
/* Received IP address */
|
||||
remoteaddr = (in[1] & 0xff);
|
||||
|
@ -1573,7 +1568,6 @@ handshake_raw_udp(int dns_fd, int seed)
|
|||
server.s_addr = ntohl(remoteaddr);
|
||||
break;
|
||||
}
|
||||
/*XXX END adjust indent 1 tab back*/
|
||||
|
||||
fprintf(stderr, ".");
|
||||
fflush(stderr);
|
||||
|
@ -2098,7 +2092,6 @@ handshake_switch_codec(int dns_fd, int bits)
|
|||
|
||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 's', 'S', i+1);
|
||||
|
||||
/*XXX START adjust indent 1 tab back*/
|
||||
if (read > 0) {
|
||||
if (strncmp("BADLEN", in, 6) == 0) {
|
||||
fprintf(stderr, "Server got bad message length. ");
|
||||
|
@ -2115,7 +2108,6 @@ handshake_switch_codec(int dns_fd, int bits)
|
|||
dataenc = tempenc;
|
||||
return;
|
||||
}
|
||||
/*XXX END adjust indent 1 tab back*/
|
||||
|
||||
fprintf(stderr, "Retrying codec switch...\n");
|
||||
}
|
||||
|
@ -2153,7 +2145,6 @@ handshake_switch_downenc(int dns_fd)
|
|||
|
||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 'o', 'O', i+1);
|
||||
|
||||
/*XXX START adjust indent 1 tab back*/
|
||||
if (read > 0) {
|
||||
if (strncmp("BADLEN", in, 6) == 0) {
|
||||
fprintf(stderr, "Server got bad message length. ");
|
||||
|
@ -2169,7 +2160,6 @@ handshake_switch_downenc(int dns_fd)
|
|||
fprintf(stderr, "Server switched downstream to codec %s\n", in);
|
||||
return;
|
||||
}
|
||||
/*XXX END adjust indent 1 tab back*/
|
||||
|
||||
fprintf(stderr, "Retrying codec switch...\n");
|
||||
}
|
||||
|
@ -2196,7 +2186,6 @@ handshake_try_lazy(int dns_fd)
|
|||
|
||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 'o', 'O', i+1);
|
||||
|
||||
/*XXX START adjust indent 1 tab back*/
|
||||
if (read > 0) {
|
||||
if (strncmp("BADLEN", in, 6) == 0) {
|
||||
fprintf(stderr, "Server got bad message length. ");
|
||||
|
@ -2213,7 +2202,6 @@ handshake_try_lazy(int dns_fd)
|
|||
return;
|
||||
}
|
||||
}
|
||||
/*XXX END adjust indent 1 tab back*/
|
||||
|
||||
fprintf(stderr, "Retrying lazy mode switch...\n");
|
||||
}
|
||||
|
@ -2242,14 +2230,12 @@ handshake_lazyoff(int dns_fd)
|
|||
|
||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 'o', 'O', 1);
|
||||
|
||||
/*XXX START adjust indent 2 tabs back*/
|
||||
if (read == 9 && strncmp("Immediate", in, 9) == 0) {
|
||||
warnx("Server switched back to legacy mode.\n");
|
||||
lazymode = 0;
|
||||
selecttimeout = 1;
|
||||
return;
|
||||
}
|
||||
/*XXX END adjust indent 2 tabs back*/
|
||||
}
|
||||
if (!running)
|
||||
return;
|
||||
|
@ -2304,7 +2290,6 @@ fragsize_check(char *in, int read, int proposed_fragsize, int *max_fragsize)
|
|||
okay = 1;
|
||||
v = in[3] & 0xff;
|
||||
|
||||
/*XXX START adjust indent 1 tab back*/
|
||||
for (i = 3; i < read; i++, v = (v + 107) & 0xff)
|
||||
if ((in[i] & 0xff) != v) {
|
||||
okay = 0;
|
||||
|
@ -2325,7 +2310,6 @@ fragsize_check(char *in, int read, int proposed_fragsize, int *max_fragsize)
|
|||
fflush(stderr);
|
||||
return 1;
|
||||
}
|
||||
/*XXX END adjust indent 1 tab back*/
|
||||
|
||||
/* notreached */
|
||||
return 1;
|
||||
|
@ -2352,13 +2336,11 @@ handshake_autoprobe_fragsize(int dns_fd)
|
|||
|
||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 'r', 'R', 1);
|
||||
|
||||
/*XXX START adjust indent 1 tab back*/
|
||||
if (read > 0) {
|
||||
/* We got a reply */
|
||||
if (fragsize_check(in, read, proposed_fragsize, &max_fragsize) == 1)
|
||||
break;
|
||||
}
|
||||
/*XXX END adjust indent 1 tab back*/
|
||||
|
||||
fprintf(stderr, ".");
|
||||
fflush(stderr);
|
||||
|
@ -2422,7 +2404,6 @@ handshake_set_fragsize(int dns_fd, int fragsize)
|
|||
|
||||
read = handshake_waitdns(dns_fd, in, sizeof(in), 'n', 'N', i+1);
|
||||
|
||||
/*XXX START adjust indent 1 tab back*/
|
||||
if (read > 0) {
|
||||
int accepted_fragsize;
|
||||
|
||||
|
@ -2437,7 +2418,6 @@ handshake_set_fragsize(int dns_fd, int fragsize)
|
|||
accepted_fragsize = ((in[0] & 0xff) << 8) | (in[1] & 0xff);
|
||||
return;
|
||||
}
|
||||
/*XXX END adjust indent 1 tab back*/
|
||||
|
||||
fprintf(stderr, "Retrying set fragsize...\n");
|
||||
}
|
||||
|
|
|
@ -207,7 +207,6 @@ dns_encode(char *buf, size_t buflen, struct query *q, qr_t qr, char *data, size_
|
|||
(even CNAME/A/MX, 255+255+header would be >512) */
|
||||
if (dnsc_use_edns0) {
|
||||
header->arcount = htons(1);
|
||||
/*XXX START adjust indent 1 tab forward*/
|
||||
CHECKLEN(11);
|
||||
putbyte(&p, 0x00); /* Root */
|
||||
putshort(&p, 0x0029); /* OPT */
|
||||
|
@ -215,7 +214,6 @@ dns_encode(char *buf, size_t buflen, struct query *q, qr_t qr, char *data, size_
|
|||
putshort(&p, 0x0000); /* Higher bits/edns version */
|
||||
putshort(&p, 0x8000); /* Z */
|
||||
putshort(&p, 0x0000); /* Data length */
|
||||
/*XXX END adjust indent 1 tab forward*/
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -1742,7 +1742,6 @@ handle_full_packet(int tun_fd, int dns_fd, int userid)
|
|||
write_tun(tun_fd, out, outlen);
|
||||
} else {
|
||||
/* send the compressed(!) packet to other client */
|
||||
/*XXX START adjust indent 1 tab forward*/
|
||||
if (users[touser].conn == CONN_DNS_NULL) {
|
||||
if (users[touser].outpacket.len == 0) {
|
||||
start_new_outpacket(touser,
|
||||
|
@ -1766,7 +1765,6 @@ handle_full_packet(int tun_fd, int dns_fd, int userid)
|
|||
users[userid].inpacket.len, touser,
|
||||
RAW_HDR_CMD_DATA, &users[touser].q);
|
||||
}
|
||||
/*XXX END adjust indent 1 tab forward*/
|
||||
}
|
||||
} else {
|
||||
if (debug >= 1)
|
||||
|
|
Loading…
Reference in New Issue