Browse Source

Fix #1291

pull/1379/head
Max Lv 8 years ago
parent
commit
f3d298f036
10 changed files with 58 additions and 13 deletions
  1. 3
      configure.ac
  2. 4
      src/cache.c
  3. 7
      src/cache.h
  4. 7
      src/local.h
  5. 7
      src/manager.h
  6. 14
      src/redir.h
  7. 10
      src/resolv.c
  8. 7
      src/server.h
  9. 5
      src/tunnel.h
  10. 7
      src/udprelay.h

3
configure.ac

@ -225,7 +225,8 @@ AC_DEFINE([HAVE_IPv6], [1], [Enable IPv6 support in libudns])
AC_CHECK_HEADERS([udns.h], [], [AC_MSG_ERROR([Couldn't find libudns. Try installing libudns-dev or udns-devel.])])
AC_CHECK_LIB([udns], [dns_dnlen], [LIBS="-ludns $LIBS"], [AC_MSG_ERROR([Couldn't find libudns. Try installing libudns-dev or udns-devel.])])
AC_CHECK_HEADERS([ev.h], [], [AC_MSG_ERROR([Couldn't find libev. Try installing libev-dev@<:@el@:>@.])])
AC_CHECK_HEADERS([ev.h libev/ev.h], [], [])
AC_CHECK_LIB([ev], [ev_loop_destroy], [LIBS="-lev $LIBS"], [AC_MSG_ERROR([Couldn't find libev. Try installing libev-dev@<:@el@:>@.])])
AC_CONFIG_FILES([shadowsocks-libev.pc

4
src/cache.c

@ -25,6 +25,10 @@
* License: This is licensed under the same terms as uthash itself
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <errno.h>
#include <stdlib.h>

7
src/cache.h

@ -29,7 +29,12 @@
#define _CACHE_
#include "uthash.h"
#include "ev.h"
#ifdef HAVE_LIBEV_EV_H
#include <libev/ev.h>
#else
#include <ev.h>
#endif
/**
* A cache entry

7
src/local.h

@ -23,9 +23,14 @@
#ifndef _LOCAL_H
#define _LOCAL_H
#include <ev.h>
#include <libcork/ds.h>
#ifdef HAVE_LIBEV_EV_H
#include <libev/ev.h>
#else
#include <ev.h>
#endif
#include "crypto.h"
#include "jconf.h"
#include "protocol.h"

7
src/manager.h

@ -23,10 +23,15 @@
#ifndef _MANAGER_H
#define _MANAGER_H
#include <ev.h>
#include <time.h>
#include <libcork/ds.h>
#ifdef HAVE_LIBEV_EV_H
#include <libev/ev.h>
#else
#include <ev.h>
#endif
#include "jconf.h"
#include "common.h"

14
src/redir.h

@ -1,5 +1,4 @@
/*
* redir.h - Define the redirector's buffers and callbacks
/* * redir.h - Define the redirector's buffers and callbacks
*
* Copyright (C) 2013 - 2017, Max Lv <max.c.lv@gmail.com>
*
@ -20,10 +19,15 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef _LOCAL_H
#define _LOCAL_H
#ifndef _REDIR_H
#define _REDIR_H
#ifdef HAVE_LIBEV_EV_H
#include <libev/ev.h>
#else
#include <ev.h>
#endif
#include "crypto.h"
#include "jconf.h"
@ -75,4 +79,4 @@ typedef struct remote {
uint32_t counter;
} remote_t;
#endif // _LOCAL_H
#endif // _REDIR_H

10
src/resolv.c

@ -32,14 +32,20 @@
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <ev.h>
#include <udns.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>
#include <unistd.h>
#include <udns.h>
#ifdef HAVE_LIBEV_EV_H
#include <libev/ev.h>
#else
#include <ev.h>
#endif
#include "resolv.h"
#include "utils.h"
#include "netutils.h"

7
src/server.h

@ -23,10 +23,15 @@
#ifndef _SERVER_H
#define _SERVER_H
#include <ev.h>
#include <time.h>
#include <libcork/ds.h>
#ifdef HAVE_LIBEV_EV_H
#include <libev/ev.h>
#else
#include <ev.h>
#endif
#include "crypto.h"
#include "jconf.h"
#include "resolv.h"

5
src/tunnel.h

@ -23,7 +23,12 @@
#ifndef _TUNNEL_H
#define _TUNNEL_H
#ifdef HAVE_LIBEV_EV_H
#include <libev/ev.h>
#else
#include <ev.h>
#endif
#include "crypto.h"
#include "jconf.h"

7
src/udprelay.h

@ -23,9 +23,14 @@
#ifndef _UDPRELAY_H
#define _UDPRELAY_H
#include <ev.h>
#include <time.h>
#ifdef HAVE_LIBEV_EV_H
#include <libev/ev.h>
#else
#include <ev.h>
#endif
#include "crypto.h"
#include "jconf.h"

Loading…
Cancel
Save