gthreadedresolver: Export g_resolver_records_from_res_query()

While it’s not a supported public part of the API, exporting this
symbol from the library means we can easily test the DNS record parser,
which is important to do since it handles untrusted data from the
network.
This commit is contained in:
Patrick Griffis 2021-12-15 16:53:41 +00:00 committed by Philip Withnall
parent 5462612dc3
commit 49e667d250
2 changed files with 10 additions and 1 deletions

View File

@ -652,7 +652,7 @@ g_resolver_record_type_to_rrtype (GResolverRecordType type)
g_return_val_if_reached (-1);
}
static GList *
GList *
g_resolver_records_from_res_query (const gchar *rrname,
gint rrtype,
guchar *answer,

View File

@ -42,6 +42,15 @@ typedef struct {
GLIB_AVAILABLE_IN_ALL
GType g_threaded_resolver_get_type (void) G_GNUC_CONST;
/* Used for a private test API */
GLIB_AVAILABLE_IN_ALL
GList *g_resolver_records_from_res_query (const gchar *rrname,
gint rrtype,
guchar *answer,
gint len,
gint herr,
GError **error);
G_END_DECLS
#endif /* __G_RESOLVER_H__ */