[Ddclient-forum] [ ddclient-Bugs-1984083 ] geturl doesn't follow redirects
Brought to you by:
supersandro2000,
wimpunk
From: SourceForge.net <no...@so...> - 2009-02-27 07:44:56
|
Bugs item #1984083, was opened at 2008-06-04 03:25 Message generated for change (Comment added) made by wimpunk You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=676128&aid=1984083&group_id=116817 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Other Group: current version >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Ron Isaacson (ron_isaacson) Assigned to: wimpunk (wimpunk) Summary: geturl doesn't follow redirects Initial Comment: Recently, www.zoneedit.com started issuing redirects to dynamic.zoneedit.com: % curl 'http://www.zoneedit.com/auth/dynamic.html?host=XXX.com&dnsto=X.X.X.X' <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="http://dynamic.zoneedit.com/auth/dynamic.html?host=XXX.com&dnsto=X.X.X.X">here</a>.</p> </body></html> Unfortunately, geturl doesn't implement a full-featured HTTP client, so it's not able to follow the redirect. Instead, it fails to update, but without a meaningful error message, and leaves the cache in an invalid state after a failed attempt. (See output below.) geturl should probably be changed to use LWP::UserAgent. It seems the current implementation is meant to avoid external dependencies, but switching to LWP::UserAgent would make it standards-compliant, and the whole function would probably only be about 5 lines! If you don't want to do that, please at least ensure that unexpected responses produce meaningful errors and no cache corruption. Thank you! === With no cache file: === % /usr/sbin/ddclient -daemon=0 -noquiet -debug DEBUG: get_ip: using if, eth0 reports X.X.X.X DEBUG: DEBUG: nic_zoneedit1_update ------------------- DEBUG: proxy = DEBUG: url = http://www.zoneedit.com/auth/dynamic.html?host=XXX.com&dnsto=X.X.X.X DEBUG: server = www.zoneedit.com No further messages to indicate that the response from the webserver was not as expected. === With the cache file produced after the above: === % /usr/sbin/ddclient -daemon=0 -noquiet -debug WARNING: file /var/cache/ddclient/ddclient.cache, line 3: Invalid Value for keyword 'ip' = '' DEBUG: get_ip: using if, eth0 reports X.X.X.X Use of uninitialized value in string ne at /usr/sbin/ddclient line 1968. WARNING: skipping update of XXX.com from <nothing> to X.X.X.X. WARNING: last updated <never> but last attempt on Tue Jun 3 22:44:46 2008 failed. WARNING: Wait at least 5 minutes between update attempts. After 5 minutes, repeats as above. === The cache file === % cat ddclient.cache ## ddclient-3.7.3 ## last updated at Tue Jun 3 22:44:46 2008 (1212547486) atime=1212547486,host=XXX.com,ip=,mtime=0,status=noconnect,warned-min-error-interval=0,warned-min-interval=0,wtime=0 XXX.com ---------------------------------------------------------------------- >Comment By: wimpunk (wimpunk) Date: 2009-02-27 07:44 Message: Ddclient has been written to use as less libraries as necessary. This issue has been fixed by correcting the zoneedit settings. ---------------------------------------------------------------------- Comment By: wimpunk (wimpunk) Date: 2008-06-08 12:01 Message: Logged In: YES user_id=722282 Originator: NO Your config worked correct because the server config was correct. So it could be use full to add the server to ddclient.conf when they change the server url. As I wrote before, it is a good idea to catch the redirect. But the ddclient developers has to get the time to work on it and currently it's looking like every one is missing some hours a day. ---------------------------------------------------------------------- Comment By: Ron Isaacson (ron_isaacson) Date: 2008-06-08 02:14 Message: Logged In: YES user_id=2107106 Originator: YES Been using the same config for years... oh well. Anyway, possibly even more important than handling the redirect is giving a detailed error if the response is unexpected. If the failure message contained the complete contents of the web server's response, it would be much easier to track down any problems. As is, it's impossible to figure out what ddclient is doing. Thanks! ---------------------------------------------------------------------- Comment By: wimpunk (wimpunk) Date: 2008-06-05 06:51 Message: Logged In: YES user_id=722282 Originator: NO Actually, you misconfigured ddclient if you run a recent version and you get in this error. You don't need the server= stuff if you're just using the default zoneedit settings. Besides this it is a useful thought to implement the redirect. It would probably been done not using the LWP::UserAgent because of avoiding external dependencies. We already had enough trouble when people were trying to use the ssl-support. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=676128&aid=1984083&group_id=116817 |