Browse Source

force to Werror

pull/35/head
Max Lv 10 years ago
parent
commit
e2f34732c2
4 changed files with 18 additions and 13 deletions
  1. 2
      src/Makefile.am
  2. 4
      src/Makefile.in
  3. 2
      src/include.h
  4. 23
      src/udprelay.c

2
src/Makefile.am

@ -1,4 +1,4 @@
AM_CFLAGS = -g -O2 -Wall -fno-strict-aliasing
AM_CFLAGS = -g -O2 -Wall -Wno-deprecated -Werror -fno-strict-aliasing
AM_CFLAGS += -I$(top_builddir)/libev
AM_CFLAGS += -I$(top_builddir)/libasyncns

4
src/Makefile.in

@ -248,8 +248,8 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CFLAGS = -g -O2 -Wall -fno-strict-aliasing -I$(top_builddir)/libev \
-I$(top_builddir)/libasyncns
AM_CFLAGS = -g -O2 -Wall -Wno-deprecated -Werror -fno-strict-aliasing \
-I$(top_builddir)/libev -I$(top_builddir)/libasyncns
AM_LDFLAGS = -static
SS_COMMON_LIBS = $(top_builddir)/libev/libev.la $(INET_NTOP_LIB)
ss_local_SOURCES = utils.c jconf.c json.c encrypt.c udprelay.c cache.c \

2
src/include.h

@ -8,6 +8,6 @@ int udprelay_init(const char *server_host, const char *server_port,
#ifdef UDPRELAY_REMOTE
asyncns_t *asyncns,
#endif
int method, int timeout, const char *interface_name);
int method, int timeout, const char *interface);
#endif // _INCLUDE_H

23
src/udprelay.c

@ -52,7 +52,6 @@
#define BUF_SIZE MAX_UDP_PACKET_SIZE
extern int verbose;
static const char *iface;
#ifndef __MINGW32__
static int setnonblocking(int fd)
@ -379,17 +378,17 @@ static void query_resolve_cb(EV_P_ ev_timer *watcher, int revents)
rp = result;
}
int opt = 1;
int remotefd = create_remote_socket(rp->ai_family == AF_INET6);
if (remotefd != -1)
{
setnonblocking(remotefd);
#ifdef SO_NOSIGPIPE
int opt = 1;
setsockopt(remotefd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
#endif
#ifdef SET_INTERFACE
if (iface) setinterface(remotefd, iface);
if (query_ctx->server_ctx->iface)
setinterface(remotefd, query_ctx->server_ctx->iface);
#endif
struct remote_ctx *remote_ctx = new_remote(remotefd, query_ctx->server_ctx);
@ -653,6 +652,15 @@ static void server_recv_cb (EV_P_ ev_io *w, int revents)
}
setnonblocking(remotefd);
#ifdef SO_NOSIGPIPE
int opt = 1;
setsockopt(remotefd, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt));
#endif
#ifdef SET_INTERFACE
if (server_ctx->iface)
setinterface(remotefd, server_ctx->iface);
#endif
// Init remote_ctx
remote_ctx = new_remote(remotefd, server_ctx);
remote_ctx->src_addr = src_addr;
@ -749,12 +757,9 @@ int udprelay_init(const char *server_host, const char *server_port,
#ifdef UDPRELAY_REMOTE
asyncns_t *asyncns,
#endif
int method, int timeout, const char *interface_name)
int method, int timeout, const char *interface)
{
iface = interface_name;
// Inilitialize ev loop
struct ev_loop *loop = EV_DEFAULT;
@ -776,7 +781,7 @@ int udprelay_init(const char *server_host, const char *server_port,
struct server_ctx *server_ctx = new_server_ctx(serverfd);
server_ctx->timeout = timeout;
server_ctx->method = method;
server_ctx->iface = iface;
server_ctx->iface = interface;
server_ctx->conn_cache = conn_cache;
#ifdef UDPRELAY_LOCAL
server_ctx->remote_host = remote_host;

Loading…
Cancel
Save