MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Mailer: MIME-tools 5.508 (Entity 5.508) Content-Disposition: inline In-Reply-To: X-RT-Interface: Web Content-Transfer-Encoding: binary X-RT-Original-Encoding: utf-8 Message-ID: References: <20170817074309.GA13444@jurassic> <20170817080438.GA15109@jurassic> <20170911172020.GA11477@jurassic> RT-Send-CC: Content-Length: 1108 On Mon Sep 11 07:20:29 2017, muks wrote: > Hi Mark > > On Tue, Aug 22, 2017 at 03:57:46AM +0000, Mark Andrews via RT wrote: > > Moved DNS_NAMEATTR_NOCOMPRESS and DNS_COMPRESS_GLOBAL14 tests be done > > in the first if and unconditional save the offset if the pointer is > > present. This allows for future code to change these flags between > > calls to dns_name_towire2. > > Though moving this check from the bottom of the function makes it more > robust, for performance reasons I left it the way it was so that the > condition is evaluated only once for the first towire call. > > Note that we already assume that the caller is calling a second time > with comp_offsetp != NULL && *comp_offsetp < 0x4000 with a correct > offset for the *identical name* that was rendered previously. > > So we did not perform many compares in the "if" at the start to make the > second dns_name_towire() call as a fastpath. Its use-case is unlikely to > be outside towiresorted() where the owner names are always compressed. > > I've pushed a slight tweak to the branch.. please check it. > > Mukund looks fine.