Skip to content

Commit c0b5a13

Browse files
committed
Merge pull request #147 from madeye/v1.5.2
V1.5.2
2 parents 84a5270 + 042749d commit c0b5a13

34 files changed

+3134
-3343
lines changed

.uncrustify.cfg

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#
2+
# based on uncrustify config file for the linux kernel
3+
#
4+
5+
code_width = 80
6+
indent_case_brace = 4
7+
indent_columns = 4
8+
indent_label = 2 # pos: absolute col, neg: relative column
9+
indent_with_tabs = 0
10+
11+
#
12+
# inter-symbol newlines
13+
#
14+
nl_brace_else = remove # "} else" vs "} \n else" - cuddle else
15+
nl_brace_while = remove # "} while" vs "} \n while" - cuddle while
16+
nl_do_brace = remove # "do {" vs "do \n {"
17+
nl_else_brace = remove # "else {" vs "else \n {"
18+
nl_enum_brace = remove # "enum {" vs "enum \n {"
19+
nl_fcall_brace = remove # "list_for_each() {" vs "list_for_each()\n{"
20+
nl_fdef_brace = force # "int foo() {" vs "int foo()\n{"
21+
nl_for_brace = remove # "for () {" vs "for () \n {"
22+
nl_func_var_def_blk = 0 # don't add newlines after a block of var declarations
23+
nl_if_brace = remove # "if () {" vs "if () \n {"
24+
nl_multi_line_define = true
25+
nl_struct_brace = remove # "struct {" vs "struct \n {"
26+
nl_switch_brace = remove # "switch () {" vs "switch () \n {"
27+
nl_union_brace = remove # "union {" vs "union \n {"
28+
nl_while_brace = remove # "while () {" vs "while () \n {"
29+
30+
31+
#
32+
# Source code modifications
33+
#
34+
mod_full_brace_do = force # "do a--; while ();" vs "do { a--; } while ();"
35+
mod_full_brace_for = force # "for () a--;" vs "for () { a--; }"
36+
mod_full_brace_if = force # "if (a) a--;" vs "if (a) { a--; }"
37+
mod_full_brace_nl = 3 # don't remove if more than 3 newlines
38+
mod_full_brace_while = force # "while (a) a--;" vs "while (a) { a--; }"
39+
mod_paren_on_return = remove # "return 1;" vs "return (1);"
40+
41+
42+
#
43+
# inter-character spacing options
44+
#
45+
sp_after_cast = remove # "(int) a" vs "(int)a"
46+
sp_after_comma = force
47+
sp_after_sparen = force # "if () {" vs "if (){"
48+
sp_arith = force
49+
sp_assign = force
50+
sp_assign = force
51+
sp_before_comma = remove
52+
sp_before_ptr_star = force # "char *foo" vs "char* foo
53+
sp_before_sparen = force # "if (" vs "if("
54+
sp_between_ptr_star = remove # "char * *foo" vs "char **foo"
55+
sp_bool = force
56+
sp_compare = force
57+
sp_func_call_paren = remove # "foo (" vs "foo("
58+
sp_func_def_paren = remove # "int foo (){" vs "int foo(){"
59+
sp_func_proto_paren = remove # "int foo ();" vs "int foo();"
60+
sp_inside_braces = force # "{ 1 }" vs "{1}"
61+
sp_inside_braces_enum = force # "{ 1 }" vs "{1}"
62+
sp_inside_braces_struct = force # "{ 1 }" vs "{1}"
63+
sp_inside_sparen = remove
64+
sp_paren_brace = force
65+
sp_sizeof_paren = remove # "sizeof (int)" vs "sizeof(int)"
66+
sp_else_brace = force
67+
sp_brace_else = force
68+
69+
#
70+
# Aligning stuff
71+
#
72+
align_enum_equ_span = 4 # '=' in enum definition
73+
align_nl_cont = true
74+
align_on_tabstop = FALSE # align on tabstops
75+
align_right_cmt_span = 3
76+
align_struct_init_span = 1
77+
align_struct_init_span = 3 # align stuff in a structure init '= { }'
78+
align_var_def_star_style = 2 # void *foo;
79+
align_var_struct_span = 0
80+
align_with_tabs = FALSE # use tabs to align

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ It is a port of [shadowsocks](https://github.com/clowwindy/shadowsocks)
1111
created by [@clowwindy](https://github.com/clowwindy) maintained by
1212
[@madeye](https://github.com/madeye) and [@linusyang](https://github.com/linusyang).
1313

14-
Current version: 1.5.1 | [![Build Status](https://travis-ci.org/madeye/shadowsocks-libev.png?branch=master)](https://travis-ci.org/madeye/shadowsocks-libev) | [Changelog](Changes)
14+
Current version: 1.5.2 | [![Build Status](https://travis-ci.org/madeye/shadowsocks-libev.png?branch=master)](https://travis-ci.org/madeye/shadowsocks-libev) | [Changelog](Changes)
1515

1616
Features
1717
--------

configure

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.68 for shadowsocks 1.5.1.
3+
# Generated by GNU Autoconf 2.68 for shadowsocks 1.5.2.
44
#
55
# Report bugs to <max.c.lv@gmail.com>.
66
#
@@ -570,8 +570,8 @@ MAKEFLAGS=
570570
# Identity of this package.
571571
PACKAGE_NAME='shadowsocks'
572572
PACKAGE_TARNAME='shadowsocks'
573-
PACKAGE_VERSION='1.5.1'
574-
PACKAGE_STRING='shadowsocks 1.5.1'
573+
PACKAGE_VERSION='1.5.2'
574+
PACKAGE_STRING='shadowsocks 1.5.2'
575575
PACKAGE_BUGREPORT='max.c.lv@gmail.com'
576576
PACKAGE_URL=''
577577

@@ -1307,7 +1307,7 @@ if test "$ac_init_help" = "long"; then
13071307
# Omit some internal or obsolete options to make the list less imposing.
13081308
# This message is too long to be a string in the A/UX 3.1 sh.
13091309
cat <<_ACEOF
1310-
\`configure' configures shadowsocks 1.5.1 to adapt to many kinds of systems.
1310+
\`configure' configures shadowsocks 1.5.2 to adapt to many kinds of systems.
13111311
13121312
Usage: $0 [OPTION]... [VAR=VALUE]...
13131313
@@ -1377,7 +1377,7 @@ fi
13771377

13781378
if test -n "$ac_init_help"; then
13791379
case $ac_init_help in
1380-
short | recursive ) echo "Configuration of shadowsocks 1.5.1:";;
1380+
short | recursive ) echo "Configuration of shadowsocks 1.5.2:";;
13811381
esac
13821382
cat <<\_ACEOF
13831383
@@ -1494,7 +1494,7 @@ fi
14941494
test -n "$ac_init_help" && exit $ac_status
14951495
if $ac_init_version; then
14961496
cat <<\_ACEOF
1497-
shadowsocks configure 1.5.1
1497+
shadowsocks configure 1.5.2
14981498
generated by GNU Autoconf 2.68
14991499
15001500
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2016,7 +2016,7 @@ cat >config.log <<_ACEOF
20162016
This file contains any messages produced by compilers while
20172017
running configure, to aid debugging if configure makes a mistake.
20182018
2019-
It was created by shadowsocks $as_me 1.5.1, which was
2019+
It was created by shadowsocks $as_me 1.5.2, which was
20202020
generated by GNU Autoconf 2.68. Invocation command line was
20212021
20222022
$ $0 $@
@@ -2837,7 +2837,7 @@ fi
28372837

28382838
# Define the identity of the package.
28392839
PACKAGE='shadowsocks'
2840-
VERSION='1.5.1'
2840+
VERSION='1.5.2'
28412841

28422842

28432843
cat >>confdefs.h <<_ACEOF
@@ -15533,7 +15533,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1553315533
# report actual input values of CONFIG_FILES etc. instead of their
1553415534
# values after options handling.
1553515535
ac_log="
15536-
This file was extended by shadowsocks $as_me 1.5.1, which was
15536+
This file was extended by shadowsocks $as_me 1.5.2, which was
1553715537
generated by GNU Autoconf 2.68. Invocation command line was
1553815538
1553915539
CONFIG_FILES = $CONFIG_FILES
@@ -15599,7 +15599,7 @@ _ACEOF
1559915599
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1560015600
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1560115601
ac_cs_version="\\
15602-
shadowsocks config.status 1.5.1
15602+
shadowsocks config.status 1.5.2
1560315603
configured by $0, generated by GNU Autoconf 2.68,
1560415604
with options \\"\$ac_cs_config\\"
1560515605

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ dnl -*- Autoconf -*-
22
dnl Process this file with autoconf to produce a configure script.
33

44
AC_PREREQ([2.67])
5-
AC_INIT([shadowsocks], [1.5.1], [max.c.lv@gmail.com])
5+
AC_INIT([shadowsocks], [1.5.2], [max.c.lv@gmail.com])
66
AC_CONFIG_SRCDIR([src/encrypt.c])
77
AC_CONFIG_HEADERS([config.h])
88
AC_CONFIG_AUX_DIR(auto)

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
shadowsocks (1.5.2-1) unstable; urgency=low
2+
3+
* Handle SIGTERM and SIGKILL nicely.
4+
5+
-- Max Lv <max.c.lv@gmail.com> Tue, 12 Nov 2014 13:11:29 +0800
6+
17
shadowsocks (1.5.1-1) unstable; urgency=low
28

39
* Fix a bug of tcp fast open.

openwrt/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include $(TOPDIR)/rules.mk
22

33
PKG_NAME:=shadowsocks-libev
4-
PKG_VERSION:=1.5.1
4+
PKG_VERSION:=1.5.2
55
PKG_RELEASE=$(PKG_SOURCE_VERSION)
66

77
PKG_SOURCE_URL:=https://github.com/madeye/shadowsocks-libev/archive

src/acl.c

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,20 @@ static void parse_addr_cidr(const char *str, char **host, int *cidr)
3434
char *pch;
3535

3636
pch = strchr(str, '/');
37-
while (pch != NULL)
38-
{
37+
while (pch != NULL) {
3938
n++;
4039
ret = pch - str;
4140
pch = strchr(pch + 1, '/');
4241
}
43-
if (n > 1)
44-
{
45-
if (strcmp(str+ret, "]") != 0)
46-
{
42+
if (n > 1) {
43+
if (strcmp(str + ret, "]") != 0) {
4744
ret = -1;
4845
}
4946
}
50-
if (ret == -1)
51-
{
47+
if (ret == -1) {
5248
*host = strdup(str);
5349
*cidr = -1;
54-
}
55-
else
56-
{
50+
} else {
5751
*host = ss_strndup(str, ret);
5852
*cidr = atoi(strdup(str + ret + 1));
5953
}
@@ -75,39 +69,35 @@ int init_acl(const char *path)
7569
}
7670

7771
char line[256];
78-
while(!feof(f))
79-
{
80-
if (fgets(line, 256, f))
81-
{
72+
while (!feof(f)) {
73+
if (fgets(line, 256, f)) {
8274
// Trim the newline
8375
int len = strlen(line);
84-
if (len > 0 && line[len - 1] == '\n')
85-
{
76+
if (len > 0 && line[len - 1] == '\n') {
8677
line[len - 1] = '\0';
8778
}
8879

8980
char *host = NULL;
9081
int cidr;
9182
parse_addr_cidr(line, &host, &cidr);
9283

93-
if (cidr == -1)
94-
{
84+
if (cidr == -1) {
9585
cork_string_array_append(&acl_domain_array, host);
96-
}
97-
else
98-
{
86+
} else {
9987
struct cork_ipv4 addr;
10088
int err = cork_ipv4_init(&addr, host);
101-
if (!err)
102-
{
103-
if (cidr >= 0)
89+
if (!err) {
90+
if (cidr >= 0) {
10491
ipset_ipv4_add_network(&acl_ip_set, &addr, cidr);
105-
else
92+
} else {
10693
ipset_ipv4_add(&acl_ip_set, &addr);
94+
}
10795
}
10896
}
10997

110-
if (host != NULL) free(host);
98+
if (host != NULL) {
99+
free(host);
100+
}
111101
}
112102
}
113103

@@ -121,39 +111,43 @@ void free_acl(void)
121111
ipset_done(&acl_ip_set);
122112
}
123113

124-
int acl_contains_domain(const char* domain)
114+
int acl_contains_domain(const char * domain)
125115
{
126116
const char **list = acl_domain_array.items;
127117
const int size = acl_domain_array.size;
128118
const int domain_len = strlen(domain);
129119
int i, offset;
130120

131-
for (i = 0; i < size; i++)
132-
{
121+
for (i = 0; i < size; i++) {
133122
const char *acl_domain = list[i];
134123
const int acl_domain_len = strlen(acl_domain);
135-
if (acl_domain_len > domain_len) continue;
124+
if (acl_domain_len > domain_len) {
125+
continue;
126+
}
136127
int match = true;
137-
for (offset = 1; offset <= acl_domain_len; offset++)
138-
{
139-
if (domain[domain_len - offset] != acl_domain[acl_domain_len - offset])
140-
{
128+
for (offset = 1; offset <= acl_domain_len; offset++) {
129+
if (domain[domain_len - offset] !=
130+
acl_domain[acl_domain_len - offset]) {
141131
match = false;
142132
break;
143133
}
144134
}
145-
if (match) return 1;
135+
if (match) {
136+
return 1;
137+
}
146138
}
147139

148140

149141
return 0;
150142
}
151143

152-
int acl_contains_ip(const char* host)
144+
int acl_contains_ip(const char * host)
153145
{
154146
struct cork_ipv4 addr;
155147
int err = cork_ipv4_init(&addr, host);
156-
if (err) return 0;
148+
if (err) {
149+
return 0;
150+
}
157151

158152
struct cork_ip ip;
159153
cork_ip_from_ipv4(&ip, &addr);

src/acl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
int init_acl(const char *path);
2727
void free_acl(void);
2828

29-
int acl_contains_ip(const char* ip);
30-
int acl_contains_domain(const char* domain);
29+
int acl_contains_ip(const char * ip);
30+
int acl_contains_domain(const char * domain);
3131

3232
#endif // _ACL_H

0 commit comments

Comments
 (0)