In this PR, I fixed an ANR issue by adding a context.Context object to the doh.Transport.Query method. This ctx will be passed to all network related calls, and it will be cancelled when user Disconnects.
But if we just simply add ctx to the method, gomobile requires we export all related packages (e.g., time) that are used by context.Context, which is not applicable. Therefore we refactored the go code structure and introduced a new backend package that will be the only interface that Java code can use.
In addition, I retired github.com/eycorsican/go-tun2socks/common/log and introduced our own logging package.
TODO Items
The refactoring of backend package is not done yet (for example, intra, intra/split and intra/protect are still exported to Java), but it will involve a lot of changes that are not related to this PR, therefore I would postpone them to future changes.
In this PR, I fixed an ANR issue by adding a
context.Context
object to thedoh.Transport.Query
method. Thisctx
will be passed to all network related calls, and it will be cancelled when userDisconnect
s.But if we just simply add
ctx
to the method,gomobile
requires we export all related packages (e.g.,time
) that are used bycontext.Context
, which is not applicable. Therefore we refactored the go code structure and introduced a newbackend
package that will be the only interface that Java code can use.In addition, I retired
github.com/eycorsican/go-tun2socks/common/log
and introduced our ownlogging
package.TODO Items
The refactoring of
backend
package is not done yet (for example,intra
,intra/split
andintra/protect
are still exported to Java), but it will involve a lot of changes that are not related to this PR, therefore I would postpone them to future changes.