If the update call fails, log the response from the remote service

bump PKGREVISION
This commit is contained in:
abs 2015-08-14 20:24:27 +00:00
parent 05b794c7f4
commit 392e684774
3 changed files with 43 additions and 2 deletions

View file

@ -1,6 +1,7 @@
# $NetBSD: Makefile,v 1.9 2015/04/04 07:59:33 snj Exp $
# $NetBSD: Makefile,v 1.10 2015/08/14 20:24:27 abs Exp $
DISTNAME= inadyn-1.99.13
PKGREVISION= 1
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_GITHUB:=troglobit/}
EXTRACT_SUFX= .zip

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.5 2015/04/04 07:59:33 snj Exp $
$NetBSD: distinfo,v 1.6 2015/08/14 20:24:27 abs Exp $
SHA1 (inadyn-1.99.13.zip) = 1294b252979dccb6ecb926d9460d36fa54c97bfe
RMD160 (inadyn-1.99.13.zip) = 09c4795277621128810f5342efd81a46fe555b8c
@ -6,6 +6,7 @@ Size (inadyn-1.99.13.zip) = 233771 bytes
SHA1 (patch-include_ddns.h) = 3d5ae83a33eb848d755364c0d67d9e996bd0aa76
SHA1 (patch-man_inadyn.8) = 66d66eeea6d59bd2c747083003215a124ed0b4d2
SHA1 (patch-man_inadyn.conf.5) = 56dc41756aba768d18d057f0199d4f7a2dbc9b25
SHA1 (patch-plugins_freedns.c) = befb431e0c4b2ae74735c2b9a6533b534e752b9a
SHA1 (patch-src_Makefile.in) = 5ef9f6cb1a6623450e7ca6f144c777f4e11d9b2e
SHA1 (patch-src_configure.ac) = 69eabc245c47a20c067bbd5b49dda70f08011aae
SHA1 (patch-src_os.c) = bcbcf79661fe6d3efca02a0293901fa4f1eb2819

View file

@ -0,0 +1,39 @@
$NetBSD: patch-plugins_freedns.c,v 1.1 2015/08/14 20:24:28 abs Exp $
If the update call fails, log the response from the remote service
--- plugins/freedns.c.orig 2015-07-14 15:29:28.000000000 +0000
+++ plugins/freedns.c
@@ -55,7 +55,7 @@ static int request(ddns_t *ctx, ddns_inf
int i, rc = 0;
http_t client;
http_trans_t trans;
- char *buf, *tmp, *line, *hash = NULL;
+ char *buf, *tmp, *line, *hash = NULL, *errmsg = NULL;
char host[256], updateurl[256];
char buffer[256];
char digeststr[SHA1_DIGEST_BYTES * 2 + 1];
@@ -109,15 +109,20 @@ static int request(ddns_t *ctx, ddns_inf
}
free(buf);
- if (!hash)
+ if (!hash) {
+ errmsg = trans.p_rsp_body;
rc = RC_DYNDNS_RSP_NOTOK;
- else
+ } else
hash++;
}
while (0);
if (rc) {
- logit(LOG_INFO, "Update URL query failed");
+ if (errmsg != NULL) {
+ logit(LOG_INFO, "Update URL query failed (%s)", errmsg);
+ } else {
+ logit(LOG_INFO, "Update URL query failed");
+ }
return 0;
}