Bug 70074

Summary: Support SRV DNS resolution
Product: [Unmaintained] kdelibs Reporter: Pierre THIERRY <nowhere.man>
Component: generalAssignee: Thiago Macieira <thiago>
Status: RESOLVED FIXED    
Severity: wishlist CC: coline_s
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Pierre THIERRY 2003-12-11 00:49:53 UTC
Version:            (using KDE KDE 3.1.4)
Installed from:    Debian testing/unstable Packages
OS:          Linux

RFC 2782 defines a DNS RR to specify where services are located, server address and port. It gave ability to host different services at different machines without being forced to name them according to their purpose (even with aliases), and also to use fine load-balancing and failover.

Konqueror should resolve an HTTP URI with SRV RR. (maybe KDE should provide globally a way to do it...)
Comment 1 Thiago Macieira 2003-12-11 02:28:15 UTC
It's been in my TO-DO list for a couple of years. I hope to get it working for KDE 3.3.

I am lacking, though, a working implementation to base on or use.
Comment 2 Pierre THIERRY 2004-05-11 13:09:39 UTC
You could dig in these projects:

http://libsrv.sourceforge.net/
http://www.nongnu.org/ruli/
Comment 3 Thiago Macieira 2004-05-11 13:37:35 UTC
Thank you, I will take a look.
Comment 4 Thiago Macieira 2005-01-28 10:44:43 UTC
*** Bug 93904 has been marked as a duplicate of this bug. ***
Comment 5 James McIninch 2005-05-13 18:54:50 UTC
DNS SRV support should be provided throughout, not just kio_http but kio_ftp, webdav, fish, etc.
Comment 6 Thiago Macieira 2005-06-01 05:31:31 UTC
I am working on this:

http://websvn.kde.org/branches/work/srv-resolution/
Comment 7 Thiago Macieira 2005-08-09 07:17:53 UTC
I forgot to CC this bug.
   
SVN commit 443592 by thiago:

Merging branch in branches/work/kdecorenetwork-srv-resolution back to
the main line: implements SRV-based DNS lookups according to RFC 2782.

The code is in working condition and should compile for
everyone. Bug me if it doesn't.

Missing feature: sort the per-priority entries according to weight. This
is a "SHOULD" feature according to the RFC. I'll implement it somewhen.

Foward-port to KDE4 will not happen now because there's no QDns replacement
outside the Qt3Support library.


 M  +3 -1      Makefile.am  
 M  +4 -2      kresolver.h  
 M  +10 -1     kresolvermanager.cpp  
 A             ksrvresolverworker.cpp   branches/work/kdecorenetwork-srv-resolution/ksrvresolverworker.cpp#443589
 A             ksrvresolverworker_p.h   branches/work/kdecorenetwork-srv-resolution/ksrvresolverworker_p.h#443589


--- branches/KDE/3.5/kdelibs/kdecore/network/Makefile.am #443591:443592
@@ -26,7 +26,8 @@
                khttpproxysocketdevice.cpp \
                ksockssocketdevice.cpp \
                kbufferedsocket.cpp \
-               ksocketbuffer.cpp
+               ksocketbuffer.cpp \
+               ksrvresolverworker.cpp
 
 include_HEADERS = kresolver.h \
        kreverseresolver.h \
@@ -48,6 +49,7 @@
        kresolverworkerbase.h \
        kresolverstandardworkers_p.h \
        ksocketbuffer_p.h \
+       ksrvresolverworker_p.h \
        syssocket.h
 
 configdir = $(kde_confdir)
--- branches/KDE/3.5/kdelibs/kdecore/network/kresolver.h #443591:443592
@@ -341,7 +341,8 @@
    *           be found and recorded
    * @li NoResolve: request that no external resolution be performed. The given
    *           nodename and servicename will be resolved locally only.
-   * @li NoSrv: don't try to use SRV-based name-resolution.
+   * @li NoSrv: don't try to use SRV-based name-resolution. (deprecated)
+   * @li UseSrv: use SRV-based name resolution.
    * @li Multiport: the port/service argument is a list of port numbers and
    *           ranges. (future extension)
    *
@@ -353,7 +354,8 @@
       CanonName = 0x02,
       NoResolve = 0x04,
       NoSrv = 0x08,
-      Multiport = 0x10
+      Multiport = 0x10,
+      UseSrv = 0x20
     };
 
   /**
--- branches/KDE/3.5/kdelibs/kdecore/network/kresolvermanager.cpp #443591:443592
@@ -53,8 +53,16 @@
 #include "kresolver.h"
 #include "kresolver_p.h"
 #include "kresolverworkerbase.h"
-#include "kresolverstandardworkers_p.h"
 
+namespace KNetwork
+{
+  namespace Internal
+  {
+    void initSrvWorker();
+    void initStandardWorkers();
+  }
+}
+
 using namespace KNetwork;
 using namespace KNetwork::Internal;
 
@@ -325,6 +333,7 @@
   globalManager = this;
   workers.setAutoDelete(true);
   currentRequests.setAutoDelete(true);
+  initSrvWorker();
   initStandardWorkers();
 
   pid = getpid();
Comment 8 Pierre THIERRY 2005-10-20 14:35:07 UTC
If a SHOULD feature doesn't work, shouldn't this bug remain open?
Comment 9 Thiago Macieira 2005-10-20 19:14:13 UTC
SRV resolution works. Bug closed.

The weighing per priority is subject of a new bug (wish) report.