Hey Iordan, On Sun, Sep 15, 2013 at 02:13:05PM -0400, i iordanov wrote: > Hi Christophe, > > I've tested the function and made one small change (bytes had to be > unref-ed before ca_file). This works for my purposes and solves my > issue of not being able to download the file using glib network I/O. > Would you be willing to include it in govirt? Notice that it > automatically uses set_downloaded_ca_cert() to set the ca property of > OvirtProxy. > > void ovirt_proxy_load_ca_cert_file (OvirtProxy *proxy, > const gchar *ca_file_name, > GError **error) > { > GMappedFile *ca_file = NULL; > GBytes *bytes = NULL; > gconstpointer ca_data; > gsize cert_length = 0; > > ca_file = g_mapped_file_new(ca_file_name, FALSE, error); > if (ca_file == NULL) { > goto error; > } > > bytes = g_mapped_file_get_bytes(ca_file); > cert_length = g_bytes_get_size(bytes); > ca_data = g_bytes_get_data (bytes, &cert_length); I think this can be done more simply using g_file_get_contents() rather than using a GMappedFile. Christophe
Attachment:
pgpyYklKXALhr.pgp
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel