Loading configure.in +1 −1 Original line number Diff line number Diff line Loading @@ -645,7 +645,7 @@ else fi # Add some more warnings which we use in the cvs version but not in the # released versions. (Some relevant gcc versions can't handle these.) #CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Winit-self -Wwrite-strings -Waggregate-return -Wmissing-declarations -Wmissing-field-initializers -Wredundant-decls -Winline" #CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Winit-self -Wwrite-strings -Waggregate-return -Wmissing-declarations -Wmissing-field-initializers -Wredundant-decls -Winline -Wnested-externs -Wswitch-enums" # Add these in when you feel like fun. #CFLAGS="$CFLAGS -Wbad-function-cast -Werror -Wdeclaration-after-statement -Wold-style-definition" Loading src/common/compat.h +28 −14 Original line number Diff line number Diff line Loading @@ -89,6 +89,19 @@ extern INLINE double U64_TO_DBL(uint64_t x) { #define DBL_TO_U64(x) ((uint64_t) (x)) #endif /* GCC has several useful attributes. */ #ifdef __GNUC__ #define ATTR_NORETURN __attribute__((noreturn)) #define ATTR_PURE __attribute__((pure)) #define ATTR_MALLOC __attribute__((malloc)) #define ATTR_NONNULL(x) __attribute__((nonnull x)) #else #define ATTR_NORETURN #define ATTR_PURE #define ATTR_MALLOC #define ATTR_NONNULL(x) #endif /* ===== String compatibility */ #ifdef MS_WINDOWS /* Windows names string functions differently from most other platforms. */ Loading @@ -96,10 +109,10 @@ extern INLINE double U64_TO_DBL(uint64_t x) { #define strcasecmp stricmp #endif #ifndef HAVE_STRLCAT size_t strlcat(char *dst, const char *src, size_t siz); size_t strlcat(char *dst, const char *src, size_t siz) ATTR_NONNULL((1,2)); #endif #ifndef HAVE_STRLCPY size_t strlcpy(char *dst, const char *src, size_t siz); size_t strlcpy(char *dst, const char *src, size_t siz) ATTR_NONNULL((1,2)); #endif #ifdef _MSC_VER Loading @@ -120,15 +133,16 @@ typedef struct tor_mmap_t { size_t size; } tor_mmap_t; tor_mmap_t *tor_mmap_file(const char *filename); void tor_munmap_file(tor_mmap_t *handle); tor_mmap_t *tor_mmap_file(const char *filename) ATTR_NONNULL((1)); void tor_munmap_file(tor_mmap_t *handle) ATTR_NONNULL((1)); int tor_snprintf(char *str, size_t size, const char *format, ...) CHECK_PRINTF(3,4); int tor_vsnprintf(char *str, size_t size, const char *format, va_list args); CHECK_PRINTF(3,4) ATTR_NONNULL((1,3)); int tor_vsnprintf(char *str, size_t size, const char *format, va_list args) ATTR_NONNULL((1,3)); const void *tor_memmem(const void *haystack, size_t hlen, const void *needle, size_t nlen); size_t nlen) ATTR_PURE ATTR_NONNULL((1,3)); #define TOR_ISALPHA(c) isalpha((int)(unsigned char)(c)) #define TOR_ISALNUM(c) isalnum((int)(unsigned char)(c)) Loading Loading @@ -197,8 +211,8 @@ typedef int socklen_t; #endif struct in_addr; int tor_inet_aton(const char *cp, struct in_addr *addr); int tor_lookup_hostname(const char *name, uint32_t *addr); int tor_inet_aton(const char *cp, struct in_addr *addr) ATTR_NONNULL((1,2)); int tor_lookup_hostname(const char *name, uint32_t *addr) ATTR_NONNULL((1,2)); void set_socket_nonblocking(int socket); int tor_socketpair(int family, int type, int protocol, int fd[2]); int network_init(void); Loading Loading @@ -243,10 +257,10 @@ const char *tor_socket_strerror(int e); /* ===== OS compatibility */ const char *get_uname(void); uint16_t get_uint16(const char *cp); uint32_t get_uint32(const char *cp); void set_uint16(char *cp, uint16_t v); void set_uint32(char *cp, uint32_t v); uint16_t get_uint16(const char *cp) ATTR_PURE ATTR_NONNULL((1)); uint32_t get_uint32(const char *cp) ATTR_PURE ATTR_NONNULL((1)); void set_uint16(char *cp, uint16_t v) ATTR_NONNULL((1)); void set_uint32(char *cp, uint32_t v) ATTR_NONNULL((1)); int set_max_file_descriptors(unsigned long limit, unsigned long cap); int switch_id(char *user, char *group); Loading @@ -255,7 +269,7 @@ char *get_user_homedir(const char *username); #endif int spawn_func(int (*func)(void *), void *data); void spawn_exit(void); void spawn_exit(void) ATTR_NORETURN; #if defined(ENABLE_THREADS) && defined(MS_WINDOWS) #define USE_WIN32_THREADS Loading src/common/container.h +11 −9 Original line number Diff line number Diff line Loading @@ -32,10 +32,10 @@ void smartlist_remove(smartlist_t *sl, const void *element); void *smartlist_pop_last(smartlist_t *sl); void smartlist_reverse(smartlist_t *sl); void smartlist_string_remove(smartlist_t *sl, const char *element); int smartlist_isin(const smartlist_t *sl, const void *element); int smartlist_string_isin(const smartlist_t *sl, const char *element); int smartlist_string_num_isin(const smartlist_t *sl, int num); int smartlist_overlap(const smartlist_t *sl1, const smartlist_t *sl2); int smartlist_isin(const smartlist_t *sl, const void *element) ATTR_PURE; int smartlist_string_isin(const smartlist_t *sl, const char *element) ATTR_PURE; int smartlist_string_num_isin(const smartlist_t *sl, int num) ATTR_PURE; int smartlist_overlap(const smartlist_t *sl1, const smartlist_t *sl2) ATTR_PURE; void smartlist_intersect(smartlist_t *sl1, const smartlist_t *sl2); void smartlist_subtract(smartlist_t *sl1, const smartlist_t *sl2); Loading @@ -43,13 +43,13 @@ void smartlist_subtract(smartlist_t *sl1, const smartlist_t *sl2); #ifdef DEBUG_SMARTLIST /** Return the number of items in sl. */ extern INLINE int smartlist_len(const smartlist_t *sl) { extern INLINE int smartlist_len(const smartlist_t *sl) ATTR_PURE { tor_assert(sl); return (sl)->num_used; } /** Return the <b>idx</b>th element of sl. */ extern INLINE void *smartlist_get(const smartlist_t *sl, int idx) { extern INLINE void *smartlist_get(const smartlist_t *sl, int idx) ATTR_PURE { tor_assert(sl); tor_assert(idx>=0); tor_assert(sl->num_used < idx); Loading @@ -75,7 +75,8 @@ void smartlist_sort(smartlist_t *sl, void smartlist_sort_strings(smartlist_t *sl); void smartlist_sort_digests(smartlist_t *sl); void *smartlist_bsearch(smartlist_t *sl, const void *key, int (*compare)(const void *key, const void **member)); int (*compare)(const void *key, const void **member)) ATTR_PURE; void smartlist_pqueue_add(smartlist_t *sl, int (*compare)(const void *a, const void *b), Loading @@ -90,9 +91,10 @@ void smartlist_pqueue_assert_ok(smartlist_t *sl, int smartlist_split_string(smartlist_t *sl, const char *str, const char *sep, int flags, int max); char *smartlist_join_strings(smartlist_t *sl, const char *join, int terminate, size_t *len_out); size_t *len_out) ATTR_MALLOC; char *smartlist_join_strings2(smartlist_t *sl, const char *join, size_t join_len, int terminate, size_t *len_out); size_t join_len, int terminate, size_t *len_out) ATTR_MALLOC; /** Iterate over the items in a smartlist <b>sl</b>, in order. For each item, * assign it to a new local variable of type <b>type</b> named <b>var</b>, and Loading src/common/util.h +30 −26 Original line number Diff line number Diff line Loading @@ -62,12 +62,14 @@ #define tor_fragile_assert() /* Memory management */ void *_tor_malloc(size_t size DMALLOC_PARAMS); void *_tor_malloc_zero(size_t size DMALLOC_PARAMS); void *_tor_malloc(size_t size DMALLOC_PARAMS) ATTR_MALLOC; void *_tor_malloc_zero(size_t size DMALLOC_PARAMS) ATTR_MALLOC; void *_tor_realloc(void *ptr, size_t size DMALLOC_PARAMS); char *_tor_strdup(const char *s DMALLOC_PARAMS); char *_tor_strndup(const char *s, size_t n DMALLOC_PARAMS); void *_tor_memdup(const void *mem, size_t len DMALLOC_PARAMS); char *_tor_strdup(const char *s DMALLOC_PARAMS) ATTR_MALLOC ATTR_NONNULL((1)); char *_tor_strndup(const char *s, size_t n DMALLOC_PARAMS) ATTR_MALLOC ATTR_NONNULL((1)); void *_tor_memdup(const void *mem, size_t len DMALLOC_PARAMS) ATTR_MALLOC ATTR_NONNULL((1)); #ifdef USE_DMALLOC extern int dmalloc_free(const char *file, const int line, void *pnt, const int func_id); Loading @@ -94,15 +96,17 @@ extern int dmalloc_free(const char *file, const int line, void *pnt, /* String manipulation */ #define HEX_CHARACTERS "0123456789ABCDEFabcdef" void tor_strlower(char *s); void tor_strupper(char *s); int tor_strisprint(const char *s); int tor_strisnonupper(const char *s); int strcmpstart(const char *s1, const char *s2); int strcasecmpstart(const char *s1, const char *s2); int strcmpend(const char *s1, const char *s2); int strcasecmpend(const char *s1, const char *s2); int tor_strstrip(char *s, const char *strip); void tor_strlower(char *s) ATTR_NONNULL((1)); void tor_strupper(char *s) ATTR_NONNULL((1)); int tor_strisprint(const char *s) ATTR_PURE ATTR_NONNULL((1)); int tor_strisnonupper(const char *s) ATTR_PURE ATTR_NONNULL((1)); int strcmpstart(const char *s1, const char *s2) ATTR_PURE ATTR_NONNULL((1,2)); int strcasecmpstart(const char *s1, const char *s2) ATTR_PURE ATTR_NONNULL((1,2)); int strcmpend(const char *s1, const char *s2) ATTR_PURE ATTR_NONNULL((1,2)); int strcasecmpend(const char *s1, const char *s2) ATTR_PURE ATTR_NONNULL((1,2)); int tor_strstrip(char *s, const char *strip) ATTR_NONNULL((1,2)); typedef enum { ALWAYS_TERMINATE, NEVER_TERMINATE, TERMINATE_IF_EVEN } part_finish_rule_t; Loading @@ -115,13 +119,13 @@ unsigned long tor_parse_ulong(const char *s, int base, unsigned long min, unsigned long max, int *ok, char **next); uint64_t tor_parse_uint64(const char *s, int base, uint64_t min, uint64_t max, int *ok, char **next); const char *hex_str(const char *from, size_t fromlen); const char *eat_whitespace(const char *s); const char *eat_whitespace_no_nl(const char *s); const char *find_whitespace(const char *s); int tor_mem_is_zero(const char *mem, size_t len); int tor_digest_is_zero(const char *digest); char *esc_for_log(const char *string); const char *hex_str(const char *from, size_t fromlen) ATTR_NONNULL((1)); const char *eat_whitespace(const char *s) ATTR_PURE; const char *eat_whitespace_no_nl(const char *s) ATTR_PURE; const char *find_whitespace(const char *s) ATTR_PURE; int tor_mem_is_zero(const char *mem, size_t len) ATTR_PURE; int tor_digest_is_zero(const char *digest) ATTR_PURE; char *esc_for_log(const char *string) ATTR_MALLOC; const char *escaped(const char *string); void base16_encode(char *dest, size_t destlen, const char *src, size_t srclen); Loading Loading @@ -165,15 +169,15 @@ int write_chunks_to_file(const char *fname, const struct smartlist_t *chunks, int append_bytes_to_file(const char *fname, const char *str, size_t len, int bin); char *read_file_to_str(const char *filename, int bin); char *read_file_to_str(const char *filename, int bin) ATTR_MALLOC; char *parse_line_from_str(char *line, char **key_out, char **value_out); char *expand_filename(const char *filename); struct smartlist_t *tor_listdir(const char *dirname); int path_is_relative(const char *filename); int path_is_relative(const char *filename) ATTR_PURE; /* Net helpers */ int is_internal_IP(uint32_t ip, int for_listening); int is_local_IP(uint32_t ip); int is_internal_IP(uint32_t ip, int for_listening) ATTR_PURE; int is_local_IP(uint32_t ip) ATTR_PURE; int parse_addr_port(int severity, const char *addrport, char **address, uint32_t *addr, uint16_t *port_out); int parse_port_range(const char *port, uint16_t *port_min_out, Loading @@ -184,7 +188,7 @@ int parse_addr_and_port_range(const char *s, uint32_t *addr_out, int addr_mask_get_bits(uint32_t mask); #define INET_NTOA_BUF_LEN 16 int tor_inet_ntoa(struct in_addr *in, char *buf, size_t buf_len); char *tor_dup_addr(uint32_t addr); char *tor_dup_addr(uint32_t addr) ATTR_MALLOC; int is_plausible_address(const char *name); int get_interface_address(uint32_t *addr); Loading src/or/circuitbuild.c +2 −3 Original line number Diff line number Diff line Loading @@ -334,6 +334,8 @@ circuit_handle_first_hop(origin_circuit_t *circ) return 0; } extern smartlist_t *circuits_pending_or_conns; /** Find any circuits that are waiting on <b>or_conn</b> to become * open and get them to send their create cells forward. * Loading @@ -342,7 +344,6 @@ circuit_handle_first_hop(origin_circuit_t *circ) void circuit_n_conn_done(or_connection_t *or_conn, int status) { extern smartlist_t *circuits_pending_or_conns; smartlist_t *changed_circs; log_debug(LD_CIRC,"or_conn to %s, status=%d", Loading Loading @@ -478,8 +479,6 @@ should_use_create_fast_for_router(routerinfo_t *router) return 1; } extern int has_completed_circuit; /** This is the backbone function for building circuits. * * If circ's first hop is closed, then we need to build a create Loading Loading
configure.in +1 −1 Original line number Diff line number Diff line Loading @@ -645,7 +645,7 @@ else fi # Add some more warnings which we use in the cvs version but not in the # released versions. (Some relevant gcc versions can't handle these.) #CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Winit-self -Wwrite-strings -Waggregate-return -Wmissing-declarations -Wmissing-field-initializers -Wredundant-decls -Winline" #CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Winit-self -Wwrite-strings -Waggregate-return -Wmissing-declarations -Wmissing-field-initializers -Wredundant-decls -Winline -Wnested-externs -Wswitch-enums" # Add these in when you feel like fun. #CFLAGS="$CFLAGS -Wbad-function-cast -Werror -Wdeclaration-after-statement -Wold-style-definition" Loading
src/common/compat.h +28 −14 Original line number Diff line number Diff line Loading @@ -89,6 +89,19 @@ extern INLINE double U64_TO_DBL(uint64_t x) { #define DBL_TO_U64(x) ((uint64_t) (x)) #endif /* GCC has several useful attributes. */ #ifdef __GNUC__ #define ATTR_NORETURN __attribute__((noreturn)) #define ATTR_PURE __attribute__((pure)) #define ATTR_MALLOC __attribute__((malloc)) #define ATTR_NONNULL(x) __attribute__((nonnull x)) #else #define ATTR_NORETURN #define ATTR_PURE #define ATTR_MALLOC #define ATTR_NONNULL(x) #endif /* ===== String compatibility */ #ifdef MS_WINDOWS /* Windows names string functions differently from most other platforms. */ Loading @@ -96,10 +109,10 @@ extern INLINE double U64_TO_DBL(uint64_t x) { #define strcasecmp stricmp #endif #ifndef HAVE_STRLCAT size_t strlcat(char *dst, const char *src, size_t siz); size_t strlcat(char *dst, const char *src, size_t siz) ATTR_NONNULL((1,2)); #endif #ifndef HAVE_STRLCPY size_t strlcpy(char *dst, const char *src, size_t siz); size_t strlcpy(char *dst, const char *src, size_t siz) ATTR_NONNULL((1,2)); #endif #ifdef _MSC_VER Loading @@ -120,15 +133,16 @@ typedef struct tor_mmap_t { size_t size; } tor_mmap_t; tor_mmap_t *tor_mmap_file(const char *filename); void tor_munmap_file(tor_mmap_t *handle); tor_mmap_t *tor_mmap_file(const char *filename) ATTR_NONNULL((1)); void tor_munmap_file(tor_mmap_t *handle) ATTR_NONNULL((1)); int tor_snprintf(char *str, size_t size, const char *format, ...) CHECK_PRINTF(3,4); int tor_vsnprintf(char *str, size_t size, const char *format, va_list args); CHECK_PRINTF(3,4) ATTR_NONNULL((1,3)); int tor_vsnprintf(char *str, size_t size, const char *format, va_list args) ATTR_NONNULL((1,3)); const void *tor_memmem(const void *haystack, size_t hlen, const void *needle, size_t nlen); size_t nlen) ATTR_PURE ATTR_NONNULL((1,3)); #define TOR_ISALPHA(c) isalpha((int)(unsigned char)(c)) #define TOR_ISALNUM(c) isalnum((int)(unsigned char)(c)) Loading Loading @@ -197,8 +211,8 @@ typedef int socklen_t; #endif struct in_addr; int tor_inet_aton(const char *cp, struct in_addr *addr); int tor_lookup_hostname(const char *name, uint32_t *addr); int tor_inet_aton(const char *cp, struct in_addr *addr) ATTR_NONNULL((1,2)); int tor_lookup_hostname(const char *name, uint32_t *addr) ATTR_NONNULL((1,2)); void set_socket_nonblocking(int socket); int tor_socketpair(int family, int type, int protocol, int fd[2]); int network_init(void); Loading Loading @@ -243,10 +257,10 @@ const char *tor_socket_strerror(int e); /* ===== OS compatibility */ const char *get_uname(void); uint16_t get_uint16(const char *cp); uint32_t get_uint32(const char *cp); void set_uint16(char *cp, uint16_t v); void set_uint32(char *cp, uint32_t v); uint16_t get_uint16(const char *cp) ATTR_PURE ATTR_NONNULL((1)); uint32_t get_uint32(const char *cp) ATTR_PURE ATTR_NONNULL((1)); void set_uint16(char *cp, uint16_t v) ATTR_NONNULL((1)); void set_uint32(char *cp, uint32_t v) ATTR_NONNULL((1)); int set_max_file_descriptors(unsigned long limit, unsigned long cap); int switch_id(char *user, char *group); Loading @@ -255,7 +269,7 @@ char *get_user_homedir(const char *username); #endif int spawn_func(int (*func)(void *), void *data); void spawn_exit(void); void spawn_exit(void) ATTR_NORETURN; #if defined(ENABLE_THREADS) && defined(MS_WINDOWS) #define USE_WIN32_THREADS Loading
src/common/container.h +11 −9 Original line number Diff line number Diff line Loading @@ -32,10 +32,10 @@ void smartlist_remove(smartlist_t *sl, const void *element); void *smartlist_pop_last(smartlist_t *sl); void smartlist_reverse(smartlist_t *sl); void smartlist_string_remove(smartlist_t *sl, const char *element); int smartlist_isin(const smartlist_t *sl, const void *element); int smartlist_string_isin(const smartlist_t *sl, const char *element); int smartlist_string_num_isin(const smartlist_t *sl, int num); int smartlist_overlap(const smartlist_t *sl1, const smartlist_t *sl2); int smartlist_isin(const smartlist_t *sl, const void *element) ATTR_PURE; int smartlist_string_isin(const smartlist_t *sl, const char *element) ATTR_PURE; int smartlist_string_num_isin(const smartlist_t *sl, int num) ATTR_PURE; int smartlist_overlap(const smartlist_t *sl1, const smartlist_t *sl2) ATTR_PURE; void smartlist_intersect(smartlist_t *sl1, const smartlist_t *sl2); void smartlist_subtract(smartlist_t *sl1, const smartlist_t *sl2); Loading @@ -43,13 +43,13 @@ void smartlist_subtract(smartlist_t *sl1, const smartlist_t *sl2); #ifdef DEBUG_SMARTLIST /** Return the number of items in sl. */ extern INLINE int smartlist_len(const smartlist_t *sl) { extern INLINE int smartlist_len(const smartlist_t *sl) ATTR_PURE { tor_assert(sl); return (sl)->num_used; } /** Return the <b>idx</b>th element of sl. */ extern INLINE void *smartlist_get(const smartlist_t *sl, int idx) { extern INLINE void *smartlist_get(const smartlist_t *sl, int idx) ATTR_PURE { tor_assert(sl); tor_assert(idx>=0); tor_assert(sl->num_used < idx); Loading @@ -75,7 +75,8 @@ void smartlist_sort(smartlist_t *sl, void smartlist_sort_strings(smartlist_t *sl); void smartlist_sort_digests(smartlist_t *sl); void *smartlist_bsearch(smartlist_t *sl, const void *key, int (*compare)(const void *key, const void **member)); int (*compare)(const void *key, const void **member)) ATTR_PURE; void smartlist_pqueue_add(smartlist_t *sl, int (*compare)(const void *a, const void *b), Loading @@ -90,9 +91,10 @@ void smartlist_pqueue_assert_ok(smartlist_t *sl, int smartlist_split_string(smartlist_t *sl, const char *str, const char *sep, int flags, int max); char *smartlist_join_strings(smartlist_t *sl, const char *join, int terminate, size_t *len_out); size_t *len_out) ATTR_MALLOC; char *smartlist_join_strings2(smartlist_t *sl, const char *join, size_t join_len, int terminate, size_t *len_out); size_t join_len, int terminate, size_t *len_out) ATTR_MALLOC; /** Iterate over the items in a smartlist <b>sl</b>, in order. For each item, * assign it to a new local variable of type <b>type</b> named <b>var</b>, and Loading
src/common/util.h +30 −26 Original line number Diff line number Diff line Loading @@ -62,12 +62,14 @@ #define tor_fragile_assert() /* Memory management */ void *_tor_malloc(size_t size DMALLOC_PARAMS); void *_tor_malloc_zero(size_t size DMALLOC_PARAMS); void *_tor_malloc(size_t size DMALLOC_PARAMS) ATTR_MALLOC; void *_tor_malloc_zero(size_t size DMALLOC_PARAMS) ATTR_MALLOC; void *_tor_realloc(void *ptr, size_t size DMALLOC_PARAMS); char *_tor_strdup(const char *s DMALLOC_PARAMS); char *_tor_strndup(const char *s, size_t n DMALLOC_PARAMS); void *_tor_memdup(const void *mem, size_t len DMALLOC_PARAMS); char *_tor_strdup(const char *s DMALLOC_PARAMS) ATTR_MALLOC ATTR_NONNULL((1)); char *_tor_strndup(const char *s, size_t n DMALLOC_PARAMS) ATTR_MALLOC ATTR_NONNULL((1)); void *_tor_memdup(const void *mem, size_t len DMALLOC_PARAMS) ATTR_MALLOC ATTR_NONNULL((1)); #ifdef USE_DMALLOC extern int dmalloc_free(const char *file, const int line, void *pnt, const int func_id); Loading @@ -94,15 +96,17 @@ extern int dmalloc_free(const char *file, const int line, void *pnt, /* String manipulation */ #define HEX_CHARACTERS "0123456789ABCDEFabcdef" void tor_strlower(char *s); void tor_strupper(char *s); int tor_strisprint(const char *s); int tor_strisnonupper(const char *s); int strcmpstart(const char *s1, const char *s2); int strcasecmpstart(const char *s1, const char *s2); int strcmpend(const char *s1, const char *s2); int strcasecmpend(const char *s1, const char *s2); int tor_strstrip(char *s, const char *strip); void tor_strlower(char *s) ATTR_NONNULL((1)); void tor_strupper(char *s) ATTR_NONNULL((1)); int tor_strisprint(const char *s) ATTR_PURE ATTR_NONNULL((1)); int tor_strisnonupper(const char *s) ATTR_PURE ATTR_NONNULL((1)); int strcmpstart(const char *s1, const char *s2) ATTR_PURE ATTR_NONNULL((1,2)); int strcasecmpstart(const char *s1, const char *s2) ATTR_PURE ATTR_NONNULL((1,2)); int strcmpend(const char *s1, const char *s2) ATTR_PURE ATTR_NONNULL((1,2)); int strcasecmpend(const char *s1, const char *s2) ATTR_PURE ATTR_NONNULL((1,2)); int tor_strstrip(char *s, const char *strip) ATTR_NONNULL((1,2)); typedef enum { ALWAYS_TERMINATE, NEVER_TERMINATE, TERMINATE_IF_EVEN } part_finish_rule_t; Loading @@ -115,13 +119,13 @@ unsigned long tor_parse_ulong(const char *s, int base, unsigned long min, unsigned long max, int *ok, char **next); uint64_t tor_parse_uint64(const char *s, int base, uint64_t min, uint64_t max, int *ok, char **next); const char *hex_str(const char *from, size_t fromlen); const char *eat_whitespace(const char *s); const char *eat_whitespace_no_nl(const char *s); const char *find_whitespace(const char *s); int tor_mem_is_zero(const char *mem, size_t len); int tor_digest_is_zero(const char *digest); char *esc_for_log(const char *string); const char *hex_str(const char *from, size_t fromlen) ATTR_NONNULL((1)); const char *eat_whitespace(const char *s) ATTR_PURE; const char *eat_whitespace_no_nl(const char *s) ATTR_PURE; const char *find_whitespace(const char *s) ATTR_PURE; int tor_mem_is_zero(const char *mem, size_t len) ATTR_PURE; int tor_digest_is_zero(const char *digest) ATTR_PURE; char *esc_for_log(const char *string) ATTR_MALLOC; const char *escaped(const char *string); void base16_encode(char *dest, size_t destlen, const char *src, size_t srclen); Loading Loading @@ -165,15 +169,15 @@ int write_chunks_to_file(const char *fname, const struct smartlist_t *chunks, int append_bytes_to_file(const char *fname, const char *str, size_t len, int bin); char *read_file_to_str(const char *filename, int bin); char *read_file_to_str(const char *filename, int bin) ATTR_MALLOC; char *parse_line_from_str(char *line, char **key_out, char **value_out); char *expand_filename(const char *filename); struct smartlist_t *tor_listdir(const char *dirname); int path_is_relative(const char *filename); int path_is_relative(const char *filename) ATTR_PURE; /* Net helpers */ int is_internal_IP(uint32_t ip, int for_listening); int is_local_IP(uint32_t ip); int is_internal_IP(uint32_t ip, int for_listening) ATTR_PURE; int is_local_IP(uint32_t ip) ATTR_PURE; int parse_addr_port(int severity, const char *addrport, char **address, uint32_t *addr, uint16_t *port_out); int parse_port_range(const char *port, uint16_t *port_min_out, Loading @@ -184,7 +188,7 @@ int parse_addr_and_port_range(const char *s, uint32_t *addr_out, int addr_mask_get_bits(uint32_t mask); #define INET_NTOA_BUF_LEN 16 int tor_inet_ntoa(struct in_addr *in, char *buf, size_t buf_len); char *tor_dup_addr(uint32_t addr); char *tor_dup_addr(uint32_t addr) ATTR_MALLOC; int is_plausible_address(const char *name); int get_interface_address(uint32_t *addr); Loading
src/or/circuitbuild.c +2 −3 Original line number Diff line number Diff line Loading @@ -334,6 +334,8 @@ circuit_handle_first_hop(origin_circuit_t *circ) return 0; } extern smartlist_t *circuits_pending_or_conns; /** Find any circuits that are waiting on <b>or_conn</b> to become * open and get them to send their create cells forward. * Loading @@ -342,7 +344,6 @@ circuit_handle_first_hop(origin_circuit_t *circ) void circuit_n_conn_done(or_connection_t *or_conn, int status) { extern smartlist_t *circuits_pending_or_conns; smartlist_t *changed_circs; log_debug(LD_CIRC,"or_conn to %s, status=%d", Loading Loading @@ -478,8 +479,6 @@ should_use_create_fast_for_router(routerinfo_t *router) return 1; } extern int has_completed_circuit; /** This is the backbone function for building circuits. * * If circ's first hop is closed, then we need to build a create Loading