Commit Graph
30 Commits
Author SHA1 Message Date
Max Lv bdc77408cb Rename to shadowsocks-c with libuv, async DNS and CI lint (#3051)
Rename the project to shadowsocks-c while retaining ss-* commands, the embedding ABI, and legacy library/package lookup compatibility.

Replace libev with bundled libuv for IOCP/kqueue event backends, expand asynchronous runtime DNS coverage, and add actionlint/Ruff with strict clang-tidy failure handling. Validate native platforms, static builds, packaging, interoperability, sanitizers, and canonical/legacy consumers.

All 22 hosted checks pass at reviewed head a8493250eb.
2026-09-11 14:18:37 +08:00
Max Lv 201e70c4bd Modernize C builds with offline dependencies and portable runtime helpers (#3050)
Bundle pinned offline dependencies, remove libcork/libipset and submodule requirements, and add portable runtime helpers with relocatable static/shared library installations.

Add Clang static build validation for Linux/musl, macOS and Windows, real TCP/UDP and SIP003 interoperability coverage, and recorded performance tradeoffs. All 21 hosted checks pass at the reviewed PR head 8d504e6218.
2026-09-11 13:42:11 +08:00
Max Lv dd5e954ab4 Clean up 2018-09-02 17:21:23 -07:00
xnor 14b6261b40 Optimize resolv timer
Don't call ares_timeout since it does a search through all queries.
Instead, schedule a timer that fires after 1 second. If no activity happened
for over 1 second do ares timeout processing, otherwise reschedule the timer
to fire after the remaining timeout.
This also completely avoids the ev_timer_again calls for each single fd event.
2018-05-09 23:20:13 +00:00
xnor a5db5ef71f Fix DNS timeouts
C-ares creates up to two sockets per nameserver. With up to three nameservers
in resolv.conf this makes a max of six active sockets.
Having only one ev_io watcher resulted in closing watchers that were
still active, needlessly resulting in DNS timeouts.
2018-05-08 21:16:28 +00:00
Max Lv 8d3ce8b77c Make sure ev_io_stop before ev_io_set 2018-05-07 09:05:38 +08:00
Max Lv c61736e903 Set the minimum resolv timeout to be one second 2018-05-04 10:33:09 +08:00
Linus Yang f4c612f832 Support TCP fast open on Windows 2018-03-09 17:46:38 +08:00
Linus Yang 2ed8791dab Re-add support for MinGW 2018-03-08 17:26:11 +08:00
Max Lv be795e1985 Refine query interface 2017-12-27 22:18:55 -08:00
Max Lv 10ce3ed5d3 Refine query handling 2017-12-27 21:52:17 -08:00
星野ハジメ cc1bb4cf62 format with .uncrustify.cfg (#1759)
* format with .uncrustify.cfg

format with .uncrustify.cfg

* format with .uncrustify.cfg

* format with .uncrustify.cfg exclude json.* base64.* uthash.h

* format with .uncrustify.cfg exclude json.* base64.* uthash.h
2017-10-30 21:28:53 +08:00
Max Lv c213ef1963 Add ARES_VERSION_MAJOR 2017-09-13 10:12:00 +08:00
Max Lv 0cb9cbe50d Fix #1682 2017-09-12 12:57:58 +08:00
Max Lv 277d6d0b5b Disable DNS rotate 2017-09-12 09:01:12 +08:00
Max Lv 01df436bb1 Refine #1677 2017-09-11 09:42:48 +08:00
Max Lv ede744ae7c Add c-ares support (#1655)
* Replace udns with c-ares

* Get IO loop work

* Clean up

* Avoid initializing nameservers each query

* Add ARES_OPT_SERVERS

* Refine resolv_cancel

* Fix a memory leak

* Replace udns.h with ares.h

* Fix all inet_* fucntions

* Clean up

* Enable servers_ports when VERSION_MINOR >= 11

* Avoid ares_inet_XtoX

* Handle multipe nameservers correctly

* Use ares_set_servers for IPv4 and IPv6 mixed list

* Refine c-ares for udprelay

* Refine ares_set_servers()

* Refine the timer based on ares_timeout

* Avoid resolv_cancel

* Fix an issue of null pointer

* Fix another null pointer issue

* Refine the order of resolv_shutdown

* Fix the corrupted ev io
2017-08-31 09:16:07 +08:00
Max Lv 44b0eae3ef Fix #1291 2017-02-23 09:35:12 +08:00
Max Lv 3f8cd982e5 Drop MinGW32 support 2017-01-24 20:10:31 +08:00
Syrone Wong e6c0780435 memset zero before using
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-12-10 21:37:56 -06:00
Syrone Wong 9db8c3abe8 zeroize some structs before using
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-12-08 04:11:43 -06:00
Max Lv b28638ab80 Clean up 2016-09-09 13:17:58 +08:00
Max Lv 63969727fc Fix a typo, close #757 2016-08-04 14:19:09 +08:00
Max Lv a9b85a5216 Refine #669: Bind to loopback for local resolver 2016-06-09 08:42:45 +08:00
Max Lv 72ee77ea35 Fix #615 2016-04-28 10:34:26 +08:00
Max Lv 114128668c Refine helper functions 2016-04-16 00:43:27 +08:00
Syrone Wong ebe79bbbd8 Refine memory management (#579)
- Added one macro to avoid dangling pointers
- Added two functions to perform NULL pointer check
  since the allocation is not guaranteed by C library, although it
  is a rare case, just for sanity
- Add NULL pointer check to brealloc() and bfree() and for sanity as well

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-04-15 09:16:38 -07:00
Max Lv b0600a8784 Refine buffer handling 2015-11-30 15:03:04 +08:00
Max Lv 64c494e18f Fix issues with MinGW 2015-01-10 16:28:16 +09:00
Max Lv e5289e9ba4 Replace libasyncns with libudns 2015-01-10 12:31:13 +09:00