mirror of https://github.com/getdnsapi/getdns.git
Fix issues accumulated when tpkg didn't work
This commit is contained in:
parent
8c4ed6294e
commit
6d29f7fb65
|
@ -501,6 +501,8 @@ sha512.lo sha512.o: $(srcdir)/compat/sha512.c \
|
||||||
config.h
|
config.h
|
||||||
strlcpy.lo strlcpy.o: $(srcdir)/compat/strlcpy.c \
|
strlcpy.lo strlcpy.o: $(srcdir)/compat/strlcpy.c \
|
||||||
config.h
|
config.h
|
||||||
|
strptime.lo strptime.o: $(srcdir)/compat/strptime.c \
|
||||||
|
config.h
|
||||||
locks.lo locks.o: $(srcdir)/util/locks.c \
|
locks.lo locks.o: $(srcdir)/util/locks.c \
|
||||||
config.h \
|
config.h \
|
||||||
$(srcdir)/util/locks.h $(srcdir)/util/orig-headers/locks.h $(srcdir)/util/auxiliary/util/log.h $(srcdir)/debug.h
|
$(srcdir)/util/locks.h $(srcdir)/util/orig-headers/locks.h $(srcdir)/util/auxiliary/util/log.h $(srcdir)/debug.h
|
||||||
|
@ -557,4 +559,4 @@ select_eventloop.lo select_eventloop.o: $(srcdir)/extension/select_eventloop.c \
|
||||||
$(srcdir)/extension/select_eventloop.h \
|
$(srcdir)/extension/select_eventloop.h \
|
||||||
getdns/getdns.h \
|
getdns/getdns.h \
|
||||||
getdns/getdns_extra.h \
|
getdns/getdns_extra.h \
|
||||||
$(srcdir)/debug.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h
|
$(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/util/orig-headers/rbtree.h $(srcdir)/debug.h
|
||||||
|
|
|
@ -721,7 +721,7 @@ static uint8_t *tas_validate(struct mem_funcs *mf,
|
||||||
void _getdns_context_equip_with_anchor(
|
void _getdns_context_equip_with_anchor(
|
||||||
getdns_context *context, uint64_t *now_ms)
|
getdns_context *context, uint64_t *now_ms)
|
||||||
{
|
{
|
||||||
uint8_t xml_spc[4096], *xml_data;
|
uint8_t xml_spc[4096], *xml_data = NULL;
|
||||||
uint8_t p7s_spc[4096], *p7s_data = NULL;
|
uint8_t p7s_spc[4096], *p7s_data = NULL;
|
||||||
size_t xml_len, p7s_len;
|
size_t xml_len, p7s_len;
|
||||||
const char *verify_email = NULL;
|
const char *verify_email = NULL;
|
||||||
|
|
|
@ -82,6 +82,9 @@ static struct const_info consts_info[] = {
|
||||||
{ 622, "GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS", GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS_TEXT },
|
{ 622, "GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS", GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS_TEXT },
|
||||||
{ 623, "GETDNS_CONTEXT_CODE_TLS_BACKOFF_TIME", GETDNS_CONTEXT_CODE_TLS_BACKOFF_TIME_TEXT },
|
{ 623, "GETDNS_CONTEXT_CODE_TLS_BACKOFF_TIME", GETDNS_CONTEXT_CODE_TLS_BACKOFF_TIME_TEXT },
|
||||||
{ 624, "GETDNS_CONTEXT_CODE_TLS_CONNECTION_RETRIES", GETDNS_CONTEXT_CODE_TLS_CONNECTION_RETRIES_TEXT },
|
{ 624, "GETDNS_CONTEXT_CODE_TLS_CONNECTION_RETRIES", GETDNS_CONTEXT_CODE_TLS_CONNECTION_RETRIES_TEXT },
|
||||||
|
{ 625, "GETDNS_CONTEXT_CODE_TRUST_ANCHOR_URL", GETDNS_CONTEXT_CODE_TRUST_ANCHOR_URL_TEXT },
|
||||||
|
{ 626, "GETDNS_CONTEXT_CODE_TRUST_ANCHOR_VERIFY_CA", GETDNS_CONTEXT_CODE_TRUST_ANCHOR_VERIFY_CA_TEXT },
|
||||||
|
{ 627, "GETDNS_CONTEXT_CODE_TRUST_ANCHOR_VERIFY_EMAIL", GETDNS_CONTEXT_CODE_TRUST_ANCHOR_VERIFY_EMAIL_TEXT },
|
||||||
{ 700, "GETDNS_CALLBACK_COMPLETE", GETDNS_CALLBACK_COMPLETE_TEXT },
|
{ 700, "GETDNS_CALLBACK_COMPLETE", GETDNS_CALLBACK_COMPLETE_TEXT },
|
||||||
{ 701, "GETDNS_CALLBACK_CANCEL", GETDNS_CALLBACK_CANCEL_TEXT },
|
{ 701, "GETDNS_CALLBACK_CANCEL", GETDNS_CALLBACK_CANCEL_TEXT },
|
||||||
{ 702, "GETDNS_CALLBACK_TIMEOUT", GETDNS_CALLBACK_TIMEOUT_TEXT },
|
{ 702, "GETDNS_CALLBACK_TIMEOUT", GETDNS_CALLBACK_TIMEOUT_TEXT },
|
||||||
|
@ -174,6 +177,9 @@ static struct const_name_info consts_name_info[] = {
|
||||||
{ "GETDNS_CONTEXT_CODE_TLS_BACKOFF_TIME", 623 },
|
{ "GETDNS_CONTEXT_CODE_TLS_BACKOFF_TIME", 623 },
|
||||||
{ "GETDNS_CONTEXT_CODE_TLS_CONNECTION_RETRIES", 624 },
|
{ "GETDNS_CONTEXT_CODE_TLS_CONNECTION_RETRIES", 624 },
|
||||||
{ "GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE", 620 },
|
{ "GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE", 620 },
|
||||||
|
{ "GETDNS_CONTEXT_CODE_TRUST_ANCHOR_URL", 625 },
|
||||||
|
{ "GETDNS_CONTEXT_CODE_TRUST_ANCHOR_VERIFY_CA", 626 },
|
||||||
|
{ "GETDNS_CONTEXT_CODE_TRUST_ANCHOR_VERIFY_EMAIL", 627 },
|
||||||
{ "GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS", 603 },
|
{ "GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS", 603 },
|
||||||
{ "GETDNS_DNSSEC_BOGUS", 401 },
|
{ "GETDNS_DNSSEC_BOGUS", 401 },
|
||||||
{ "GETDNS_DNSSEC_INDETERMINATE", 402 },
|
{ "GETDNS_DNSSEC_INDETERMINATE", 402 },
|
||||||
|
|
|
@ -4629,7 +4629,8 @@ uint8_t *_getdns_context_get_priv_file(getdns_context *context,
|
||||||
GETDNS_FREE(context->mf, buf);
|
GETDNS_FREE(context->mf, buf);
|
||||||
buf = NULL;
|
buf = NULL;
|
||||||
}
|
}
|
||||||
buf[*file_sz] = 0;
|
else
|
||||||
|
buf[*file_sz] = 0;
|
||||||
}
|
}
|
||||||
(void) fclose(f);
|
(void) fclose(f);
|
||||||
return buf;
|
return buf;
|
||||||
|
|
46
src/debug.h
46
src/debug.h
|
@ -47,41 +47,41 @@
|
||||||
|
|
||||||
#ifdef GETDNS_ON_WINDOWS
|
#ifdef GETDNS_ON_WINDOWS
|
||||||
#define DEBUG_ON(...) do { \
|
#define DEBUG_ON(...) do { \
|
||||||
struct timeval tv; \
|
struct timeval tv_dEbUgSyM; \
|
||||||
struct tm tm; \
|
struct tm tm_dEbUgSyM; \
|
||||||
char buf[10]; \
|
char buf_dEbUgSyM[10]; \
|
||||||
time_t tsec; \
|
time_t tsec_dEbUgSyM; \
|
||||||
\
|
\
|
||||||
gettimeofday(&tv, NULL); \
|
gettimeofday(&tv_dEbUgSyM, NULL); \
|
||||||
tsec = (time_t) tv.tv_sec; \
|
tsec = (time_t) tv_dEbUgSyM.tv_sec; \
|
||||||
gmtime_s(&tm, (const time_t *) &tsec); \
|
gmtime_s(&tm_dEbUgSyM, (const time_t *) &tsec_dEbUgSyM); \
|
||||||
strftime(buf, 10, "%H:%M:%S", &tm); \
|
strftime(buf_dEbUgSyM, 10, "%H:%M:%S", &tm_dEbUgSyM); \
|
||||||
fprintf(stderr, "[%s.%.6d] ", buf, (int)tv.tv_usec); \
|
fprintf(stderr, "[%s.%.6d] ", buf_dEbUgSyM, (int)tv_dEbUgSyM.tv_usec); \
|
||||||
fprintf(stderr, __VA_ARGS__); \
|
fprintf(stderr, __VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#else
|
#else
|
||||||
#define DEBUG_ON(...) do { \
|
#define DEBUG_ON(...) do { \
|
||||||
struct timeval tv; \
|
struct timeval tv_dEbUgSyM; \
|
||||||
struct tm tm; \
|
struct tm tm_dEbUgSyM; \
|
||||||
char buf[10]; \
|
char buf_dEbUgSyM[10]; \
|
||||||
\
|
\
|
||||||
gettimeofday(&tv, NULL); \
|
gettimeofday(&tv_dEbUgSyM, NULL); \
|
||||||
gmtime_r(&tv.tv_sec, &tm); \
|
gmtime_r(&tv_dEbUgSyM.tv_sec, &tm_dEbUgSyM); \
|
||||||
strftime(buf, 10, "%H:%M:%S", &tm); \
|
strftime(buf_dEbUgSyM, 10, "%H:%M:%S", &tm_dEbUgSyM); \
|
||||||
fprintf(stderr, "[%s.%.6d] ", buf, (int)tv.tv_usec); \
|
fprintf(stderr, "[%s.%.6d] ", buf_dEbUgSyM, (int)tv_dEbUgSyM.tv_usec); \
|
||||||
fprintf(stderr, __VA_ARGS__); \
|
fprintf(stderr, __VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEBUG_NL(...) do { \
|
#define DEBUG_NL(...) do { \
|
||||||
struct timeval tv; \
|
struct timeval tv_dEbUgSyM; \
|
||||||
struct tm tm; \
|
struct tm tm_dEbUgSyM; \
|
||||||
char buf[10]; \
|
char buf_dEbUgSyM[10]; \
|
||||||
\
|
\
|
||||||
gettimeofday(&tv, NULL); \
|
gettimeofday(&tv_dEbUgSyM, NULL); \
|
||||||
gmtime_r(&tv.tv_sec, &tm); \
|
gmtime_r(&tv_dEbUgSyM.tv_sec, &tm_dEbUgSyM); \
|
||||||
strftime(buf, 10, "%H:%M:%S", &tm); \
|
strftime(buf_dEbUgSyM, 10, "%H:%M:%S", &tm_dEbUgSyM); \
|
||||||
fprintf(stderr, "[%s.%.6d] ", buf, (int)tv.tv_usec); \
|
fprintf(stderr, "[%s.%.6d] ", buf_dEbUgSyM, (int)tv_dEbUgSyM.tv_usec); \
|
||||||
fprintf(stderr, __VA_ARGS__); \
|
fprintf(stderr, __VA_ARGS__); \
|
||||||
fprintf(stderr, "\n"); \
|
fprintf(stderr, "\n"); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
|
@ -33,6 +33,9 @@ getdns_context_get_tls_authentication
|
||||||
getdns_context_get_tls_backoff_time
|
getdns_context_get_tls_backoff_time
|
||||||
getdns_context_get_tls_connection_retries
|
getdns_context_get_tls_connection_retries
|
||||||
getdns_context_get_tls_query_padding_blocksize
|
getdns_context_get_tls_query_padding_blocksize
|
||||||
|
getdns_context_get_trust_anchor_url
|
||||||
|
getdns_context_get_trust_anchor_verify_CA
|
||||||
|
getdns_context_get_trust_anchor_verify_email
|
||||||
getdns_context_get_update_callback
|
getdns_context_get_update_callback
|
||||||
getdns_context_get_upstream_recursive_servers
|
getdns_context_get_upstream_recursive_servers
|
||||||
getdns_context_process_async
|
getdns_context_process_async
|
||||||
|
@ -67,6 +70,9 @@ getdns_context_set_tls_authentication
|
||||||
getdns_context_set_tls_backoff_time
|
getdns_context_set_tls_backoff_time
|
||||||
getdns_context_set_tls_connection_retries
|
getdns_context_set_tls_connection_retries
|
||||||
getdns_context_set_tls_query_padding_blocksize
|
getdns_context_set_tls_query_padding_blocksize
|
||||||
|
getdns_context_set_trust_anchor_url
|
||||||
|
getdns_context_set_trust_anchor_verify_CA
|
||||||
|
getdns_context_set_trust_anchor_verify_email
|
||||||
getdns_context_set_update_callback
|
getdns_context_set_update_callback
|
||||||
getdns_context_set_upstream_recursive_servers
|
getdns_context_set_upstream_recursive_servers
|
||||||
getdns_context_set_use_threads
|
getdns_context_set_use_threads
|
||||||
|
|
|
@ -11,4 +11,6 @@ then
|
||||||
then
|
then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -25,4 +25,4 @@ do
|
||||||
done
|
done
|
||||||
lcov $LCOV_MERGE -o run-all.info
|
lcov $LCOV_MERGE -o run-all.info
|
||||||
genhtml run-all.info --output-directory coverage-html
|
genhtml run-all.info --output-directory coverage-html
|
||||||
"${TPKG}" r
|
"${TPKG}" -n -1 r
|
||||||
|
|
|
@ -17,4 +17,4 @@ do
|
||||||
# trap keyboard interrupt (control-c)
|
# trap keyboard interrupt (control-c)
|
||||||
trap control_c 2
|
trap control_c 2
|
||||||
done
|
done
|
||||||
"${TPKG}" r
|
"${TPKG}" -n -1 r
|
||||||
|
|
|
@ -31,7 +31,7 @@ do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "${ALL}" >> Makefile
|
echo "${ALL}" >> Makefile
|
||||||
printf '\t"%s" r\n\n' "${TPKG}" >> Makefile
|
printf '\t"%s" -n -1 r\n\n' "${TPKG}" >> Makefile
|
||||||
printf 'clean:\n\t"%s" clean\n\trm -fr build build-stub-only build-event-loops build-static-analysis install scan-build-reports .tpkg.var.master *.info\n\n' "${TPKG}" >> Makefile
|
printf 'clean:\n\t"%s" clean\n\trm -fr build build-stub-only build-event-loops build-static-analysis install scan-build-reports .tpkg.var.master *.info\n\n' "${TPKG}" >> Makefile
|
||||||
for P in ${OTHERS}
|
for P in ${OTHERS}
|
||||||
do
|
do
|
||||||
|
|
|
@ -193,6 +193,8 @@ function usage() {
|
||||||
out " -p PRI\tlog using PRI as priority"
|
out " -p PRI\tlog using PRI as priority"
|
||||||
out " -k\t\tdon't remove test directory when creating/executing a tpkg package"
|
out " -k\t\tdon't remove test directory when creating/executing a tpkg package"
|
||||||
out " -n NUM\tif less than NUM of the tests are passed exit with 1"
|
out " -n NUM\tif less than NUM of the tests are passed exit with 1"
|
||||||
|
out " \t\tOtherwise exit with 0. When NUM is -1, no tests may fail"
|
||||||
|
out " \t\tOnly valid when running tpkg report"
|
||||||
out " \t\tOtherwise exit with 0. Only valid when running tpkg report"
|
out " \t\tOtherwise exit with 0. Only valid when running tpkg report"
|
||||||
out " -b DIR\tuse DIR is a base directory in stead of ."
|
out " -b DIR\tuse DIR is a base directory in stead of ."
|
||||||
out " -a ARGS\tpass the string ARGS through to the test scripts"
|
out " -a ARGS\tpass the string ARGS through to the test scripts"
|
||||||
|
@ -330,11 +332,12 @@ function report() {
|
||||||
if [[ $passed -lt $TPKG_PASS ]]; then
|
if [[ $passed -lt $TPKG_PASS ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
elif [[ $failed -gt 0 ]]; then
|
elif [[ $TPKG_PASS -lt 0 ]]; then
|
||||||
exit 1
|
if [[ $failed -gt 0 ]]; then
|
||||||
else
|
exit 1
|
||||||
exit 0
|
fi
|
||||||
fi
|
fi
|
||||||
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# clone test1 to test2
|
# clone test1 to test2
|
||||||
|
|
Loading…
Reference in New Issue