shawn1m / overture

A customized DNS relay server
MIT License
1.79k stars 284 forks source link

Refactored the RemoteClient to support connection pooling & drop none answer #206

Closed NyaMisty closed 4 years ago

NyaMisty commented 4 years ago

Part of RemoteClient were split into several Resolver, which will be shared across all RemoteClient and RemoteClientBundle, in the resolver the pool was implemented.

NyaMisty commented 4 years ago

Also tried to fix #181

shawn1m commented 4 years ago

Add some quick tests (something like dispatcher_test or better) for resolvers?

NyaMisty commented 4 years ago

Well in fact I tried, but later I found I all used your original resolver code and I'm a little confused about how to test it

shawn1m commented 4 years ago

And Thank you for your effort and contributation!

shawn1m commented 4 years ago

Well in fact I tried, but later I found I all used your original resolver code and I'm a little confused about how to test it

Hmm... maybe add some tests in dispatcher test to cover all these resolvers? Never mind. That is an bonus, I will consider it again afterwards.

NyaMisty commented 4 years ago

I've added a simple test for those resolvers :)

NyaMisty commented 4 years ago

Thanks, sorry for my low code quality :(

shawn1m commented 4 years ago

Thank you for your contribution. By the way, I found some EOF errors when connection pool is used so I remove the connection pool from config sample for this time being. If it is can be tested without any problem in a period of time, I will add it back.

NyaMisty commented 4 years ago

Well those connection pool parameters need to be finetuned carefully. Many DNS & proxy likes to break the connection, and that's why I added the PoolTimeout option