mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
68120d9b00
C reserves all identifiers beginning with an underscore for system use. But we had been mangling our autoconf identifiers with the prefix "_EVENT_" to avoid conflict with other programs. Instead, we will now use the prefix "EVENT__". With any luck, the double-underscore will still hint "here be dragons" to anybody tempted to think that event-config.h is a stable api. This is an automatically generated patch. The script that produced it was made by running this script over config.h.in: ===== #!/usr/bin/perl -w # Run this on config.h.in use strict; my %macros = (); while (<>) { if (/^# *undef +([A-Za-z0-9_]+)/) { $macros{$1} = 1; } } print "#!/usr/bin/perl -w -i -p\n\n"; for my $k (sort keys %macros) { print "s/(?<![A-Za-z0-9_])_EVENT_$k(?![A-Za-z0-9_])/EVENT__$k/g;\n"; } == And the script that it generated was then run over all .c and .h files: #!/usr/bin/perl -w -i -p s/(?<![A-Za-z0-9_])_EVENT_DISABLE_DEBUG_MODE(?![A-Za-z0-9_])/EVENT__DISABLE_DEBUG_MODE/g; s/(?<![A-Za-z0-9_])_EVENT_DISABLE_MM_REPLACEMENT(?![A-Za-z0-9_])/EVENT__DISABLE_MM_REPLACEMENT/g; s/(?<![A-Za-z0-9_])_EVENT_DISABLE_THREAD_SUPPORT(?![A-Za-z0-9_])/EVENT__DISABLE_THREAD_SUPPORT/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_ACCEPT4(?![A-Za-z0-9_])/EVENT__HAVE_ACCEPT4/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_ARC4RANDOM(?![A-Za-z0-9_])/EVENT__HAVE_ARC4RANDOM/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_ARC4RANDOM_BUF(?![A-Za-z0-9_])/EVENT__HAVE_ARC4RANDOM_BUF/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_ARPA_INET_H(?![A-Za-z0-9_])/EVENT__HAVE_ARPA_INET_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_CLOCK_GETTIME(?![A-Za-z0-9_])/EVENT__HAVE_CLOCK_GETTIME/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_DECL_CTL_KERN(?![A-Za-z0-9_])/EVENT__HAVE_DECL_CTL_KERN/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_DECL_KERN_ARND(?![A-Za-z0-9_])/EVENT__HAVE_DECL_KERN_ARND/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_DECL_KERN_RANDOM(?![A-Za-z0-9_])/EVENT__HAVE_DECL_KERN_RANDOM/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_DECL_RANDOM_UUID(?![A-Za-z0-9_])/EVENT__HAVE_DECL_RANDOM_UUID/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_DEVPOLL(?![A-Za-z0-9_])/EVENT__HAVE_DEVPOLL/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_DLFCN_H(?![A-Za-z0-9_])/EVENT__HAVE_DLFCN_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_EPOLL(?![A-Za-z0-9_])/EVENT__HAVE_EPOLL/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_EPOLL_CREATE1(?![A-Za-z0-9_])/EVENT__HAVE_EPOLL_CREATE1/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_EPOLL_CTL(?![A-Za-z0-9_])/EVENT__HAVE_EPOLL_CTL/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_EVENTFD(?![A-Za-z0-9_])/EVENT__HAVE_EVENTFD/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_EVENT_PORTS(?![A-Za-z0-9_])/EVENT__HAVE_EVENT_PORTS/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_FCNTL(?![A-Za-z0-9_])/EVENT__HAVE_FCNTL/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_FCNTL_H(?![A-Za-z0-9_])/EVENT__HAVE_FCNTL_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_FD_MASK(?![A-Za-z0-9_])/EVENT__HAVE_FD_MASK/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_GETADDRINFO(?![A-Za-z0-9_])/EVENT__HAVE_GETADDRINFO/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_GETEGID(?![A-Za-z0-9_])/EVENT__HAVE_GETEGID/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_GETEUID(?![A-Za-z0-9_])/EVENT__HAVE_GETEUID/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_GETHOSTBYNAME_R(?![A-Za-z0-9_])/EVENT__HAVE_GETHOSTBYNAME_R/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_GETHOSTBYNAME_R_3_ARG(?![A-Za-z0-9_])/EVENT__HAVE_GETHOSTBYNAME_R_3_ARG/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_GETHOSTBYNAME_R_5_ARG(?![A-Za-z0-9_])/EVENT__HAVE_GETHOSTBYNAME_R_5_ARG/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_GETHOSTBYNAME_R_6_ARG(?![A-Za-z0-9_])/EVENT__HAVE_GETHOSTBYNAME_R_6_ARG/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_GETIFADDRS(?![A-Za-z0-9_])/EVENT__HAVE_GETIFADDRS/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_GETNAMEINFO(?![A-Za-z0-9_])/EVENT__HAVE_GETNAMEINFO/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_GETPROTOBYNUMBER(?![A-Za-z0-9_])/EVENT__HAVE_GETPROTOBYNUMBER/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_GETSERVBYNAME(?![A-Za-z0-9_])/EVENT__HAVE_GETSERVBYNAME/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_GETTIMEOFDAY(?![A-Za-z0-9_])/EVENT__HAVE_GETTIMEOFDAY/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_IFADDRS_H(?![A-Za-z0-9_])/EVENT__HAVE_IFADDRS_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_INET_ATON(?![A-Za-z0-9_])/EVENT__HAVE_INET_ATON/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_INET_NTOP(?![A-Za-z0-9_])/EVENT__HAVE_INET_NTOP/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_INET_PTON(?![A-Za-z0-9_])/EVENT__HAVE_INET_PTON/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_INTTYPES_H(?![A-Za-z0-9_])/EVENT__HAVE_INTTYPES_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_ISSETUGID(?![A-Za-z0-9_])/EVENT__HAVE_ISSETUGID/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_KQUEUE(?![A-Za-z0-9_])/EVENT__HAVE_KQUEUE/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_LIBZ(?![A-Za-z0-9_])/EVENT__HAVE_LIBZ/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_MEMORY_H(?![A-Za-z0-9_])/EVENT__HAVE_MEMORY_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_MMAP(?![A-Za-z0-9_])/EVENT__HAVE_MMAP/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_NANOSLEEP(?![A-Za-z0-9_])/EVENT__HAVE_NANOSLEEP/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_NETDB_H(?![A-Za-z0-9_])/EVENT__HAVE_NETDB_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_NETINET_IN6_H(?![A-Za-z0-9_])/EVENT__HAVE_NETINET_IN6_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_NETINET_IN_H(?![A-Za-z0-9_])/EVENT__HAVE_NETINET_IN_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_NETINET_TCP_H(?![A-Za-z0-9_])/EVENT__HAVE_NETINET_TCP_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_OPENSSL(?![A-Za-z0-9_])/EVENT__HAVE_OPENSSL/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_PIPE(?![A-Za-z0-9_])/EVENT__HAVE_PIPE/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_PIPE2(?![A-Za-z0-9_])/EVENT__HAVE_PIPE2/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_POLL(?![A-Za-z0-9_])/EVENT__HAVE_POLL/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_POLL_H(?![A-Za-z0-9_])/EVENT__HAVE_POLL_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_PORT_CREATE(?![A-Za-z0-9_])/EVENT__HAVE_PORT_CREATE/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_PORT_H(?![A-Za-z0-9_])/EVENT__HAVE_PORT_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_PTHREAD(?![A-Za-z0-9_])/EVENT__HAVE_PTHREAD/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_PTHREADS(?![A-Za-z0-9_])/EVENT__HAVE_PTHREADS/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_PUTENV(?![A-Za-z0-9_])/EVENT__HAVE_PUTENV/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SA_FAMILY_T(?![A-Za-z0-9_])/EVENT__HAVE_SA_FAMILY_T/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SELECT(?![A-Za-z0-9_])/EVENT__HAVE_SELECT/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SENDFILE(?![A-Za-z0-9_])/EVENT__HAVE_SENDFILE/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SETENV(?![A-Za-z0-9_])/EVENT__HAVE_SETENV/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SETFD(?![A-Za-z0-9_])/EVENT__HAVE_SETFD/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SETRLIMIT(?![A-Za-z0-9_])/EVENT__HAVE_SETRLIMIT/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SIGACTION(?![A-Za-z0-9_])/EVENT__HAVE_SIGACTION/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SIGNAL(?![A-Za-z0-9_])/EVENT__HAVE_SIGNAL/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SPLICE(?![A-Za-z0-9_])/EVENT__HAVE_SPLICE/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STDARG_H(?![A-Za-z0-9_])/EVENT__HAVE_STDARG_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STDDEF_H(?![A-Za-z0-9_])/EVENT__HAVE_STDDEF_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STDINT_H(?![A-Za-z0-9_])/EVENT__HAVE_STDINT_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STDLIB_H(?![A-Za-z0-9_])/EVENT__HAVE_STDLIB_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRINGS_H(?![A-Za-z0-9_])/EVENT__HAVE_STRINGS_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRING_H(?![A-Za-z0-9_])/EVENT__HAVE_STRING_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRLCPY(?![A-Za-z0-9_])/EVENT__HAVE_STRLCPY/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRSEP(?![A-Za-z0-9_])/EVENT__HAVE_STRSEP/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRTOK_R(?![A-Za-z0-9_])/EVENT__HAVE_STRTOK_R/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRTOLL(?![A-Za-z0-9_])/EVENT__HAVE_STRTOLL/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRUCT_ADDRINFO(?![A-Za-z0-9_])/EVENT__HAVE_STRUCT_ADDRINFO/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRUCT_IN6_ADDR(?![A-Za-z0-9_])/EVENT__HAVE_STRUCT_IN6_ADDR/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRUCT_IN6_ADDR_S6_ADDR16(?![A-Za-z0-9_])/EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRUCT_IN6_ADDR_S6_ADDR32(?![A-Za-z0-9_])/EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRUCT_SOCKADDR_IN6(?![A-Za-z0-9_])/EVENT__HAVE_STRUCT_SOCKADDR_IN6/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN(?![A-Za-z0-9_])/EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRUCT_SOCKADDR_IN_SIN_LEN(?![A-Za-z0-9_])/EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRUCT_SOCKADDR_STORAGE(?![A-Za-z0-9_])/EVENT__HAVE_STRUCT_SOCKADDR_STORAGE/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY(?![A-Za-z0-9_])/EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY(?![A-Za-z0-9_])/EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYSCTL(?![A-Za-z0-9_])/EVENT__HAVE_SYSCTL/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_DEVPOLL_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_DEVPOLL_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_EPOLL_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_EPOLL_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_EVENTFD_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_EVENTFD_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_EVENT_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_EVENT_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_IOCTL_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_IOCTL_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_MMAN_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_MMAN_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_PARAM_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_PARAM_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_QUEUE_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_QUEUE_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_RESOURCE_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_RESOURCE_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_SELECT_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_SELECT_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_SENDFILE_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_SENDFILE_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_SOCKET_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_SOCKET_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_STAT_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_STAT_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_SYSCTL_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_SYSCTL_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_TIME_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_TIME_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_TYPES_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_TYPES_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_UIO_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_UIO_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_SYS_WAIT_H(?![A-Za-z0-9_])/EVENT__HAVE_SYS_WAIT_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_TAILQFOREACH(?![A-Za-z0-9_])/EVENT__HAVE_TAILQFOREACH/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_TIMERADD(?![A-Za-z0-9_])/EVENT__HAVE_TIMERADD/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_TIMERCLEAR(?![A-Za-z0-9_])/EVENT__HAVE_TIMERCLEAR/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_TIMERCMP(?![A-Za-z0-9_])/EVENT__HAVE_TIMERCMP/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_TIMERISSET(?![A-Za-z0-9_])/EVENT__HAVE_TIMERISSET/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_UINT16_T(?![A-Za-z0-9_])/EVENT__HAVE_UINT16_T/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_UINT32_T(?![A-Za-z0-9_])/EVENT__HAVE_UINT32_T/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_UINT64_T(?![A-Za-z0-9_])/EVENT__HAVE_UINT64_T/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_UINT8_T(?![A-Za-z0-9_])/EVENT__HAVE_UINT8_T/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_UINTPTR_T(?![A-Za-z0-9_])/EVENT__HAVE_UINTPTR_T/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_UNISTD_H(?![A-Za-z0-9_])/EVENT__HAVE_UNISTD_H/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_UNSETENV(?![A-Za-z0-9_])/EVENT__HAVE_UNSETENV/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_USLEEP(?![A-Za-z0-9_])/EVENT__HAVE_USLEEP/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_VASPRINTF(?![A-Za-z0-9_])/EVENT__HAVE_VASPRINTF/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_WORKING_KQUEUE(?![A-Za-z0-9_])/EVENT__HAVE_WORKING_KQUEUE/g; s/(?<![A-Za-z0-9_])_EVENT_HAVE_ZLIB_H(?![A-Za-z0-9_])/EVENT__HAVE_ZLIB_H/g; s/(?<![A-Za-z0-9_])_EVENT_LT_OBJDIR(?![A-Za-z0-9_])/EVENT__LT_OBJDIR/g; s/(?<![A-Za-z0-9_])_EVENT_NO_MINUS_C_MINUS_O(?![A-Za-z0-9_])/EVENT__NO_MINUS_C_MINUS_O/g; s/(?<![A-Za-z0-9_])_EVENT_NUMERIC_VERSION(?![A-Za-z0-9_])/EVENT__NUMERIC_VERSION/g; s/(?<![A-Za-z0-9_])_EVENT_PACKAGE(?![A-Za-z0-9_])/EVENT__PACKAGE/g; s/(?<![A-Za-z0-9_])_EVENT_PACKAGE_BUGREPORT(?![A-Za-z0-9_])/EVENT__PACKAGE_BUGREPORT/g; s/(?<![A-Za-z0-9_])_EVENT_PACKAGE_NAME(?![A-Za-z0-9_])/EVENT__PACKAGE_NAME/g; s/(?<![A-Za-z0-9_])_EVENT_PACKAGE_STRING(?![A-Za-z0-9_])/EVENT__PACKAGE_STRING/g; s/(?<![A-Za-z0-9_])_EVENT_PACKAGE_TARNAME(?![A-Za-z0-9_])/EVENT__PACKAGE_TARNAME/g; s/(?<![A-Za-z0-9_])_EVENT_PACKAGE_URL(?![A-Za-z0-9_])/EVENT__PACKAGE_URL/g; s/(?<![A-Za-z0-9_])_EVENT_PACKAGE_VERSION(?![A-Za-z0-9_])/EVENT__PACKAGE_VERSION/g; s/(?<![A-Za-z0-9_])_EVENT_PTHREAD_CREATE_JOINABLE(?![A-Za-z0-9_])/EVENT__PTHREAD_CREATE_JOINABLE/g; s/(?<![A-Za-z0-9_])_EVENT_SIZEOF_INT(?![A-Za-z0-9_])/EVENT__SIZEOF_INT/g; s/(?<![A-Za-z0-9_])_EVENT_SIZEOF_LONG(?![A-Za-z0-9_])/EVENT__SIZEOF_LONG/g; s/(?<![A-Za-z0-9_])_EVENT_SIZEOF_LONG_LONG(?![A-Za-z0-9_])/EVENT__SIZEOF_LONG_LONG/g; s/(?<![A-Za-z0-9_])_EVENT_SIZEOF_OFF_T(?![A-Za-z0-9_])/EVENT__SIZEOF_OFF_T/g; s/(?<![A-Za-z0-9_])_EVENT_SIZEOF_PTHREAD_T(?![A-Za-z0-9_])/EVENT__SIZEOF_PTHREAD_T/g; s/(?<![A-Za-z0-9_])_EVENT_SIZEOF_SHORT(?![A-Za-z0-9_])/EVENT__SIZEOF_SHORT/g; s/(?<![A-Za-z0-9_])_EVENT_SIZEOF_SIZE_T(?![A-Za-z0-9_])/EVENT__SIZEOF_SIZE_T/g; s/(?<![A-Za-z0-9_])_EVENT_SIZEOF_VOID_P(?![A-Za-z0-9_])/EVENT__SIZEOF_VOID_P/g; s/(?<![A-Za-z0-9_])_EVENT_STDC_HEADERS(?![A-Za-z0-9_])/EVENT__STDC_HEADERS/g; s/(?<![A-Za-z0-9_])_EVENT_TIME_WITH_SYS_TIME(?![A-Za-z0-9_])/EVENT__TIME_WITH_SYS_TIME/g; s/(?<![A-Za-z0-9_])_EVENT_VERSION(?![A-Za-z0-9_])/EVENT__VERSION/g; s/(?<![A-Za-z0-9_])_EVENT__ALL_SOURCE(?![A-Za-z0-9_])/EVENT___ALL_SOURCE/g; s/(?<![A-Za-z0-9_])_EVENT__FILE_OFFSET_BITS(?![A-Za-z0-9_])/EVENT___FILE_OFFSET_BITS/g; s/(?<![A-Za-z0-9_])_EVENT__GNU_SOURCE(?![A-Za-z0-9_])/EVENT___GNU_SOURCE/g; s/(?<![A-Za-z0-9_])_EVENT__LARGE_FILES(?![A-Za-z0-9_])/EVENT___LARGE_FILES/g; s/(?<![A-Za-z0-9_])_EVENT__MINIX(?![A-Za-z0-9_])/EVENT___MINIX/g; s/(?<![A-Za-z0-9_])_EVENT__POSIX_1_SOURCE(?![A-Za-z0-9_])/EVENT___POSIX_1_SOURCE/g; s/(?<![A-Za-z0-9_])_EVENT__POSIX_PTHREAD_SEMANTICS(?![A-Za-z0-9_])/EVENT___POSIX_PTHREAD_SEMANTICS/g; s/(?<![A-Za-z0-9_])_EVENT__POSIX_SOURCE(?![A-Za-z0-9_])/EVENT___POSIX_SOURCE/g; s/(?<![A-Za-z0-9_])_EVENT__TANDEM_SOURCE(?![A-Za-z0-9_])/EVENT___TANDEM_SOURCE/g; s/(?<![A-Za-z0-9_])_EVENT___EXTENSIONS__(?![A-Za-z0-9_])/EVENT____EXTENSIONS__/g; s/(?<![A-Za-z0-9_])_EVENT___func__(?![A-Za-z0-9_])/EVENT____func__/g; s/(?<![A-Za-z0-9_])_EVENT_const(?![A-Za-z0-9_])/EVENT__const/g; s/(?<![A-Za-z0-9_])_EVENT_inline(?![A-Za-z0-9_])/EVENT__inline/g; s/(?<![A-Za-z0-9_])_EVENT_pid_t(?![A-Za-z0-9_])/EVENT__pid_t/g; s/(?<![A-Za-z0-9_])_EVENT_size_t(?![A-Za-z0-9_])/EVENT__size_t/g; s/(?<![A-Za-z0-9_])_EVENT_socklen_t(?![A-Za-z0-9_])/EVENT__socklen_t/g; s/(?<![A-Za-z0-9_])_EVENT_ssize_t(?![A-Za-z0-9_])/EVENT__ssize_t/g;
479 lines
12 KiB
C
479 lines
12 KiB
C
/*
|
|
* Copyright (c) 2009-2012 Niels Provos and Nick Mathewson
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions
|
|
* are met:
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
* notice, this list of conditions and the following disclaimer.
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
* documentation and/or other materials provided with the distribution.
|
|
* 3. The name of the author may not be used to endorse or promote products
|
|
* derived from this software without specific prior written permission.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
*/
|
|
#include "../util-internal.h"
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <assert.h>
|
|
#include <math.h>
|
|
|
|
#ifdef _WIN32
|
|
#include <winsock2.h>
|
|
#include <ws2tcpip.h>
|
|
#else
|
|
#include <sys/socket.h>
|
|
#include <netinet/in.h>
|
|
# ifdef _XOPEN_SOURCE_EXTENDED
|
|
# include <arpa/inet.h>
|
|
# endif
|
|
#endif
|
|
#include <signal.h>
|
|
|
|
#include "event2/bufferevent.h"
|
|
#include "event2/buffer.h"
|
|
#include "event2/event.h"
|
|
#include "event2/util.h"
|
|
#include "event2/listener.h"
|
|
#include "event2/thread.h"
|
|
|
|
|
|
static int cfg_verbose = 0;
|
|
static int cfg_help = 0;
|
|
|
|
static int cfg_n_connections = 30;
|
|
static int cfg_duration = 5;
|
|
static int cfg_connlimit = 0;
|
|
static int cfg_grouplimit = 0;
|
|
static int cfg_tick_msec = 1000;
|
|
static int cfg_min_share = -1;
|
|
|
|
static int cfg_connlimit_tolerance = -1;
|
|
static int cfg_grouplimit_tolerance = -1;
|
|
static int cfg_stddev_tolerance = -1;
|
|
|
|
#ifdef _WIN32
|
|
static int cfg_enable_iocp = 0;
|
|
#endif
|
|
|
|
static struct timeval cfg_tick = { 0, 500*1000 };
|
|
|
|
static struct ev_token_bucket_cfg *conn_bucket_cfg = NULL;
|
|
static struct ev_token_bucket_cfg *group_bucket_cfg = NULL;
|
|
struct bufferevent_rate_limit_group *ratelim_group = NULL;
|
|
static double seconds_per_tick = 0.0;
|
|
|
|
struct client_state {
|
|
size_t queued;
|
|
ev_uint64_t received;
|
|
};
|
|
|
|
static int n_echo_conns_open = 0;
|
|
|
|
static void
|
|
loud_writecb(struct bufferevent *bev, void *ctx)
|
|
{
|
|
struct client_state *cs = ctx;
|
|
struct evbuffer *output = bufferevent_get_output(bev);
|
|
char buf[1024];
|
|
#ifdef _WIN32
|
|
int r = rand() % 256;
|
|
#else
|
|
int r = random() % 256;
|
|
#endif
|
|
memset(buf, r, sizeof(buf));
|
|
while (evbuffer_get_length(output) < 8192) {
|
|
evbuffer_add(output, buf, sizeof(buf));
|
|
cs->queued += sizeof(buf);
|
|
}
|
|
}
|
|
|
|
static void
|
|
discard_readcb(struct bufferevent *bev, void *ctx)
|
|
{
|
|
struct client_state *cs = ctx;
|
|
struct evbuffer *input = bufferevent_get_input(bev);
|
|
size_t len = evbuffer_get_length(input);
|
|
evbuffer_drain(input, len);
|
|
cs->received += len;
|
|
}
|
|
|
|
static void
|
|
write_on_connectedcb(struct bufferevent *bev, short what, void *ctx)
|
|
{
|
|
if (what & BEV_EVENT_CONNECTED) {
|
|
loud_writecb(bev, ctx);
|
|
/* XXXX this shouldn't be needed. */
|
|
bufferevent_enable(bev, EV_READ|EV_WRITE);
|
|
}
|
|
}
|
|
|
|
static void
|
|
echo_readcb(struct bufferevent *bev, void *ctx)
|
|
{
|
|
struct evbuffer *input = bufferevent_get_input(bev);
|
|
struct evbuffer *output = bufferevent_get_output(bev);
|
|
|
|
evbuffer_add_buffer(output, input);
|
|
if (evbuffer_get_length(output) > 1024000)
|
|
bufferevent_disable(bev, EV_READ);
|
|
}
|
|
|
|
static void
|
|
echo_writecb(struct bufferevent *bev, void *ctx)
|
|
{
|
|
struct evbuffer *output = bufferevent_get_output(bev);
|
|
if (evbuffer_get_length(output) < 512000)
|
|
bufferevent_enable(bev, EV_READ);
|
|
}
|
|
|
|
static void
|
|
echo_eventcb(struct bufferevent *bev, short what, void *ctx)
|
|
{
|
|
if (what & (BEV_EVENT_EOF|BEV_EVENT_ERROR)) {
|
|
--n_echo_conns_open;
|
|
bufferevent_free(bev);
|
|
}
|
|
}
|
|
|
|
static void
|
|
echo_listenercb(struct evconnlistener *listener, evutil_socket_t newsock,
|
|
struct sockaddr *sourceaddr, int socklen, void *ctx)
|
|
{
|
|
struct event_base *base = ctx;
|
|
int flags = BEV_OPT_CLOSE_ON_FREE|BEV_OPT_THREADSAFE;
|
|
struct bufferevent *bev;
|
|
|
|
bev = bufferevent_socket_new(base, newsock, flags);
|
|
bufferevent_setcb(bev, echo_readcb, echo_writecb, echo_eventcb, NULL);
|
|
if (conn_bucket_cfg)
|
|
bufferevent_set_rate_limit(bev, conn_bucket_cfg);
|
|
if (ratelim_group)
|
|
bufferevent_add_to_rate_limit_group(bev, ratelim_group);
|
|
++n_echo_conns_open;
|
|
bufferevent_enable(bev, EV_READ|EV_WRITE);
|
|
}
|
|
|
|
static int
|
|
test_ratelimiting(void)
|
|
{
|
|
struct event_base *base;
|
|
struct sockaddr_in sin;
|
|
struct evconnlistener *listener;
|
|
|
|
struct sockaddr_storage ss;
|
|
ev_socklen_t slen;
|
|
|
|
struct bufferevent **bevs;
|
|
struct client_state *states;
|
|
struct bufferevent_rate_limit_group *group = NULL;
|
|
|
|
int i;
|
|
|
|
struct timeval tv;
|
|
|
|
ev_uint64_t total_received;
|
|
double total_sq_persec, total_persec;
|
|
double variance;
|
|
double expected_total_persec = -1.0, expected_avg_persec = -1.0;
|
|
int ok = 1;
|
|
struct event_config *base_cfg;
|
|
|
|
memset(&sin, 0, sizeof(sin));
|
|
sin.sin_family = AF_INET;
|
|
sin.sin_addr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
|
|
sin.sin_port = 0; /* unspecified port */
|
|
|
|
if (0)
|
|
event_enable_debug_mode();
|
|
|
|
base_cfg = event_config_new();
|
|
|
|
#ifdef _WIN32
|
|
if (cfg_enable_iocp) {
|
|
evthread_use_windows_threads();
|
|
event_config_set_flag(base_cfg, EVENT_BASE_FLAG_STARTUP_IOCP);
|
|
}
|
|
#endif
|
|
|
|
base = event_base_new_with_config(base_cfg);
|
|
|
|
listener = evconnlistener_new_bind(base, echo_listenercb, base,
|
|
LEV_OPT_CLOSE_ON_FREE|LEV_OPT_REUSEABLE, -1,
|
|
(struct sockaddr *)&sin, sizeof(sin));
|
|
|
|
slen = sizeof(ss);
|
|
if (getsockname(evconnlistener_get_fd(listener), (struct sockaddr *)&ss,
|
|
&slen) < 0) {
|
|
perror("getsockname");
|
|
return 1;
|
|
}
|
|
|
|
if (cfg_connlimit > 0) {
|
|
conn_bucket_cfg = ev_token_bucket_cfg_new(
|
|
cfg_connlimit, cfg_connlimit * 4,
|
|
cfg_connlimit, cfg_connlimit * 4,
|
|
&cfg_tick);
|
|
assert(conn_bucket_cfg);
|
|
}
|
|
|
|
if (cfg_grouplimit > 0) {
|
|
group_bucket_cfg = ev_token_bucket_cfg_new(
|
|
cfg_grouplimit, cfg_grouplimit * 4,
|
|
cfg_grouplimit, cfg_grouplimit * 4,
|
|
&cfg_tick);
|
|
group = ratelim_group = bufferevent_rate_limit_group_new(
|
|
base, group_bucket_cfg);
|
|
expected_total_persec = cfg_grouplimit;
|
|
expected_avg_persec = cfg_grouplimit / cfg_n_connections;
|
|
if (cfg_connlimit > 0 && expected_avg_persec > cfg_connlimit)
|
|
expected_avg_persec = cfg_connlimit;
|
|
if (cfg_min_share >= 0)
|
|
bufferevent_rate_limit_group_set_min_share(
|
|
ratelim_group, cfg_min_share);
|
|
}
|
|
|
|
if (expected_avg_persec < 0 && cfg_connlimit > 0)
|
|
expected_avg_persec = cfg_connlimit;
|
|
|
|
if (expected_avg_persec > 0)
|
|
expected_avg_persec /= seconds_per_tick;
|
|
if (expected_total_persec > 0)
|
|
expected_total_persec /= seconds_per_tick;
|
|
|
|
bevs = calloc(cfg_n_connections, sizeof(struct bufferevent *));
|
|
states = calloc(cfg_n_connections, sizeof(struct client_state));
|
|
|
|
for (i = 0; i < cfg_n_connections; ++i) {
|
|
bevs[i] = bufferevent_socket_new(base, -1,
|
|
BEV_OPT_CLOSE_ON_FREE|BEV_OPT_THREADSAFE);
|
|
assert(bevs[i]);
|
|
bufferevent_setcb(bevs[i], discard_readcb, loud_writecb,
|
|
write_on_connectedcb, &states[i]);
|
|
bufferevent_enable(bevs[i], EV_READ|EV_WRITE);
|
|
bufferevent_socket_connect(bevs[i], (struct sockaddr *)&ss,
|
|
slen);
|
|
}
|
|
|
|
tv.tv_sec = cfg_duration - 1;
|
|
tv.tv_usec = 995000;
|
|
|
|
event_base_loopexit(base, &tv);
|
|
|
|
event_base_dispatch(base);
|
|
|
|
ratelim_group = NULL; /* So no more responders get added */
|
|
|
|
for (i = 0; i < cfg_n_connections; ++i) {
|
|
bufferevent_free(bevs[i]);
|
|
}
|
|
evconnlistener_free(listener);
|
|
|
|
/* Make sure no new echo_conns get added to the group. */
|
|
ratelim_group = NULL;
|
|
|
|
/* This should get _everybody_ freed */
|
|
while (n_echo_conns_open) {
|
|
printf("waiting for %d conns\n", n_echo_conns_open);
|
|
tv.tv_sec = 0;
|
|
tv.tv_usec = 300000;
|
|
event_base_loopexit(base, &tv);
|
|
event_base_dispatch(base);
|
|
}
|
|
|
|
if (group)
|
|
bufferevent_rate_limit_group_free(group);
|
|
|
|
total_received = 0;
|
|
total_persec = 0.0;
|
|
total_sq_persec = 0.0;
|
|
for (i=0; i < cfg_n_connections; ++i) {
|
|
double persec = states[i].received;
|
|
persec /= cfg_duration;
|
|
total_received += states[i].received;
|
|
total_persec += persec;
|
|
total_sq_persec += persec*persec;
|
|
printf("%d: %f per second\n", i+1, persec);
|
|
}
|
|
printf(" total: %f per second\n",
|
|
((double)total_received)/cfg_duration);
|
|
if (expected_total_persec > 0) {
|
|
double diff = expected_total_persec -
|
|
((double)total_received/cfg_duration);
|
|
printf(" [Off by %lf]\n", diff);
|
|
if (cfg_grouplimit_tolerance > 0 &&
|
|
fabs(diff) > cfg_grouplimit_tolerance) {
|
|
fprintf(stderr, "Group bandwidth out of bounds\n");
|
|
ok = 0;
|
|
}
|
|
}
|
|
|
|
printf(" average: %f per second\n",
|
|
(((double)total_received)/cfg_duration)/cfg_n_connections);
|
|
if (expected_avg_persec > 0) {
|
|
double diff = expected_avg_persec - (((double)total_received)/cfg_duration)/cfg_n_connections;
|
|
printf(" [Off by %lf]\n", diff);
|
|
if (cfg_connlimit_tolerance > 0 &&
|
|
fabs(diff) > cfg_connlimit_tolerance) {
|
|
fprintf(stderr, "Connection bandwidth out of bounds\n");
|
|
ok = 0;
|
|
}
|
|
}
|
|
|
|
variance = total_sq_persec/cfg_n_connections - total_persec*total_persec/(cfg_n_connections*cfg_n_connections);
|
|
|
|
printf(" stddev: %f per second\n", sqrt(variance));
|
|
if (cfg_stddev_tolerance > 0 &&
|
|
sqrt(variance) > cfg_stddev_tolerance) {
|
|
fprintf(stderr, "Connection variance out of bounds\n");
|
|
ok = 0;
|
|
}
|
|
|
|
event_base_free(base);
|
|
free(bevs);
|
|
free(states);
|
|
|
|
return ok ? 0 : 1;
|
|
}
|
|
|
|
static struct option {
|
|
const char *name; int *ptr; int min; int isbool;
|
|
} options[] = {
|
|
{ "-v", &cfg_verbose, 0, 1 },
|
|
{ "-h", &cfg_help, 0, 1 },
|
|
{ "-n", &cfg_n_connections, 1, 0 },
|
|
{ "-d", &cfg_duration, 1, 0 },
|
|
{ "-c", &cfg_connlimit, 0, 0 },
|
|
{ "-g", &cfg_grouplimit, 0, 0 },
|
|
{ "-t", &cfg_tick_msec, 10, 0 },
|
|
{ "--min-share", &cfg_min_share, 0, 0 },
|
|
{ "--check-connlimit", &cfg_connlimit_tolerance, 0, 0 },
|
|
{ "--check-grouplimit", &cfg_grouplimit_tolerance, 0, 0 },
|
|
{ "--check-stddev", &cfg_stddev_tolerance, 0, 0 },
|
|
#ifdef _WIN32
|
|
{ "--iocp", &cfg_enable_iocp, 0, 1 },
|
|
#endif
|
|
{ NULL, NULL, -1, 0 },
|
|
};
|
|
|
|
static int
|
|
handle_option(int argc, char **argv, int *i, const struct option *opt)
|
|
{
|
|
long val;
|
|
char *endptr = NULL;
|
|
if (opt->isbool) {
|
|
*opt->ptr = 1;
|
|
return 0;
|
|
}
|
|
if (*i + 1 == argc) {
|
|
fprintf(stderr, "Too few arguments to '%s'\n",argv[*i]);
|
|
return -1;
|
|
}
|
|
val = strtol(argv[*i+1], &endptr, 10);
|
|
if (*argv[*i+1] == '\0' || !endptr || *endptr != '\0') {
|
|
fprintf(stderr, "Couldn't parse numeric value '%s'\n",
|
|
argv[*i+1]);
|
|
return -1;
|
|
}
|
|
if (val < opt->min || val > 0x7fffffff) {
|
|
fprintf(stderr, "Value '%s' is out-of-range'\n",
|
|
argv[*i+1]);
|
|
return -1;
|
|
}
|
|
*opt->ptr = (int)val;
|
|
++*i;
|
|
return 0;
|
|
}
|
|
|
|
static void
|
|
usage(void)
|
|
{
|
|
fprintf(stderr,
|
|
"test-ratelim [-v] [-n INT] [-d INT] [-c INT] [-g INT] [-t INT]\n\n"
|
|
"Pushes bytes through a number of possibly rate-limited connections, and\n"
|
|
"displays average throughput.\n\n"
|
|
" -n INT: Number of connections to open (default: 30)\n"
|
|
" -d INT: Duration of the test in seconds (default: 5 sec)\n");
|
|
fprintf(stderr,
|
|
" -c INT: Connection-rate limit applied to each connection in bytes per second\n"
|
|
" (default: None.)\n"
|
|
" -g INT: Group-rate limit applied to sum of all usage in bytes per second\n"
|
|
" (default: None.)\n"
|
|
" -t INT: Granularity of timing, in milliseconds (default: 1000 msec)\n");
|
|
}
|
|
|
|
int
|
|
main(int argc, char **argv)
|
|
{
|
|
int i,j;
|
|
double ratio;
|
|
|
|
#ifdef _WIN32
|
|
WORD wVersionRequested = MAKEWORD(2,2);
|
|
WSADATA wsaData;
|
|
int err;
|
|
|
|
err = WSAStartup(wVersionRequested, &wsaData);
|
|
#endif
|
|
|
|
#ifndef _WIN32
|
|
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
|
|
return 1;
|
|
#endif
|
|
for (i = 1; i < argc; ++i) {
|
|
for (j = 0; options[j].name; ++j) {
|
|
if (!strcmp(argv[i],options[j].name)) {
|
|
if (handle_option(argc,argv,&i,&options[j])<0)
|
|
return 1;
|
|
goto again;
|
|
}
|
|
}
|
|
fprintf(stderr, "Unknown option '%s'\n", argv[i]);
|
|
usage();
|
|
return 1;
|
|
again:
|
|
;
|
|
}
|
|
if (cfg_help) {
|
|
usage();
|
|
return 0;
|
|
}
|
|
|
|
cfg_tick.tv_sec = cfg_tick_msec / 1000;
|
|
cfg_tick.tv_usec = (cfg_tick_msec % 1000)*1000;
|
|
|
|
seconds_per_tick = ratio = cfg_tick_msec / 1000.0;
|
|
|
|
cfg_connlimit *= ratio;
|
|
cfg_grouplimit *= ratio;
|
|
|
|
{
|
|
struct timeval tv;
|
|
evutil_gettimeofday(&tv, NULL);
|
|
#ifdef _WIN32
|
|
srand(tv.tv_usec);
|
|
#else
|
|
srandom(tv.tv_usec);
|
|
#endif
|
|
}
|
|
|
|
#ifndef EVENT__DISABLE_THREAD_SUPPORT
|
|
evthread_enable_lock_debuging();
|
|
#endif
|
|
|
|
return test_ratelimiting();
|
|
}
|