From: David O. <da...@qc...> - 2021-01-25 16:42:57
|
This is part of the commit which seems to be changing the behaviour in our case in SockSetServer in driver.c.. sockPtr->location would have previously been set to drvPtr->location here and passed on to connPtr->location in NsQueueConn I think. However, now sockPtr->location is set to NULL, and the "if (sockPtr->servPtr == NULL)" check fails in this case and sockPtr->location remains unset. [image: image.png] On Mon, 25 Jan 2021 at 11:45, David Osborne <da...@qc...> wrote: > Hi again, > > We're also having issues with the use of the "location" param to specify > the location for ns_returnredirect in the latest version of naviserver. > > We used to be able to have something like: > > ns_section ns/server/default/module/nssock > ns_param location https://domain:port > ... > > And a "ns_returnredirect /" from that server would expand "/" to " > https://domain:port/". > > However, in the latest version this doesn't seem to be the case anymore. > The redirect is being expanded to the server address (0.0.0.0 in > this case) rather than the defined location. > > > *Reproduction steps (on debian stretch)*: > > 1. Build and install Naviserver. > > 2. Changes to /usr/local/ns/conf/nsd-config.tcl > > Change ns_section "ns/fastpath" > to > > ns_section "ns/server/default/fastpath" > > Remove: > ns_section "ns/modules" > > Rename ns_section "ns/module/nssock" to > "ns/server/default/module/nssock" > Add > > ns_param location http://192.168.56.10:8080 > > Add to "ns/server/default/modules" > > ns_param nssock nssock > > 3. Add file /usr/local/ns/pages/test.tcl > containing > "ns_returnredirect /" > > 4. sudo /usr/local/ns/bin/nsd -u nsadmin -t > /usr/local/ns/conf/nsd-config.tcl -c > > 5. At naviserver 4.99.19 when visiting /test.tcl we get a 302 to the > location defined: > "Location: http://192.168.56.10:8080/" > > 6. At naviserver 4.99.20 with the same config we get redirected to the > driver address instead: > "Location: http://0.0.0.0:8080/" > > Is this a case of the new code exposing a faulty config, or has something > else changed? > > Seems to be down to *Ns_ConnLocationAppend *now having a null value in > connPtr->location at the point where the redirection is happening. So the > procedure drops back to the final option which is to query the driver > protocol, address and port. > But I'm failing to work out what change has stopped connPtr->location > being populated at this point. > > Any help would be appreciated! > > Regards, > > -- > > *David Osborne | Software Engineer* > Qcode Software, Castle House, Fairways Business Park, Inverness, IV2 6AA > *Email:* da...@qc... | *Phone:* 01463 896 484 > www.qcode.co.uk > > > -- *David Osborne | Software Engineer* Qcode Software, Castle House, Fairways Business Park, Inverness, IV2 6AA *Email:* da...@qc... | *Phone:* 01463 896 484 www.qcode.co.uk |