Hi all,
Sorry for such a long period with nothing happening.
I got an email from a user yesterday that said he was using 0.5
successfully at home but when he took it to work it bogged down quite a
fast machine.
I too have been realising how crappy 0.5 is.
So last nite I decided to rewrite dproxy from scratch ---> dproxy-nexgen
the result today.
This time there is no forking crap, its all event based. It simply listens
on port 53 UDP via a select and when ever a request/answer comes in the
packet is read and decoded. Each packet is stored in a structure that
includes both the original packet and the decoded version as well as
source address and port.
If the packet is a new query and is not in the cahce then it is added to
linked list of outstanding queries and is passed untouched on to the
upstream nameserver.
All new requests are checked against the list for entries with the same
id. Obviously if a request with the same id is already in the list then
the new request is not added. This prevents duplicates in the list.
When and answer is received the list is checked for the query with the
same transaction ID and the answer is forwarded to the src of the query
untouched. It is also added to the cache.
All this avoids the blocking gethostbyname() function.
The cache subsystem is bascially untouched, but with the locking removed.
Ditto for the config system.
I haven't put in the ISDN or DHCP stuff, yet as I hope to rewrite those
bits too.
Overall the structure should be a bit less hackish than version 0.5,
mainly because I actually followed the RFCs a bit closer this time, and I
guess experience always helps. There is still some documentation of
fuctions to be done, and some of the functions in dproxy.c should probably
be moved into seperate files but it seems to work and is an improvement
over 0.5.
Anyway you can get it out of cvs or get a tar ball from the anonymous ftp
at ftp://dproxy.sourceforge.net
Give it a try and pass on any bugs or fixes,
Matty
|