Instead of having two sets of functions; us_ssl_socket_ext and us_socket_ext, etc, you could have one single:
us_socket * can be SSL or non-SSL, it is determined by us_socket_ext(SSL or not, ...)
Instead of two different sets of functions almost identical, what is not identical could be hints instead. So SSL options could be hints that can be ignored for non-SSL.
That would clear up a lot of template magic in µWS and make it a lot easier to work with.
First step: add a new layer named us_any_socket and us_any_socket_ext, etc -> have it be a set of macros to correct function.
Second step: rename everything so that _any prefix can be removed.
Instead of having two sets of functions; us_ssl_socket_ext and us_socket_ext, etc, you could have one single:
us_socket *
can be SSL or non-SSL, it is determined by us_socket_ext(SSL or not, ...)Instead of two different sets of functions almost identical, what is not identical could be hints instead. So SSL options could be hints that can be ignored for non-SSL.
That would clear up a lot of template magic in µWS and make it a lot easier to work with.
First step: add a new layer named us_any_socket and us_any_socket_ext, etc -> have it be a set of macros to correct function.
Second step: rename everything so that _any prefix can be removed.