# HG changeset patch # User masneyb # Date 1153364221 0 # Node ID cb70c5abd8f374df830e930ecca24471d2783d90 # Parent cf2a51deefd8af9e71c635e83039b4e43594196a 2006-7-19 Brian Masney * lib/misc.c (gftp_copy_request) - updated patch that makes sure the request->hostp structure is copied properly (from (from Aurelien Jarno ) (closes #314626) diff -r cf2a51deefd8 -r cb70c5abd8f3 ChangeLog --- a/ChangeLog Thu Jul 20 02:41:26 2006 +0000 +++ b/ChangeLog Thu Jul 20 02:57:01 2006 +0000 @@ -1,4 +1,8 @@ 2006-7-19 Brian Masney + * lib/misc.c (gftp_copy_request) - updated patch that makes sure the + request->hostp structure is copied properly (from (from Aurelien Jarno + ) (closes #314626) + * src/gtk/transfer.c (check_done_process) - make sure the temporary files are removed in all cases (from Madhan Raj ) (closes #171459) @@ -3454,7 +3458,7 @@ * cvsclean - added this script - * *.[ch] - added $Id: ChangeLog,v 1.450 2006/07/20 02:41:25 masneyb Exp $ tags + * *.[ch] - added $Id: ChangeLog,v 1.451 2006/07/20 02:57:01 masneyb Exp $ tags * debian/* - updated files from Debian maintainer diff -r cf2a51deefd8 -r cb70c5abd8f3 lib/misc.c --- a/lib/misc.c Thu Jul 20 02:41:26 2006 +0000 +++ b/lib/misc.c Thu Jul 20 02:57:01 2006 +0000 @@ -572,13 +572,26 @@ if (req->hostp) { #if defined (HAVE_GETADDRINFO) && defined (HAVE_GAI_STRERROR) - newreq->hostp = g_malloc (sizeof(struct addrinfo)); - memcpy(newreq->hostp, req->hostp, sizeof(struct addrinfo)); - if (req->current_hostp) - newreq->current_hostp = newreq->hostp + (req->current_hostp - req->hostp); + struct addrinfo *hostp = req->hostp; + struct addrinfo *newhostp = newreq->hostp; + + while (hostp != NULL) + { + newhostp = g_malloc (sizeof(struct addrinfo)); + memcpy (newhostp, hostp, sizeof (struct addrinfo)); + newhostp->ai_addr = g_malloc (sizeof (struct sockaddr)); + memcpy(newhostp->ai_addr, hostp->ai_addr, sizeof (struct sockaddr)); + if (hostp->ai_canonname) + newhostp->ai_canonname = strdup(hostp->ai_canonname); + + if (req->current_hostp == hostp) + newreq->current_hostp = newhostp; + + hostp = hostp->ai_next; newhostp = newhostp->ai_next; + } #else - newreq->hostp = g_malloc (sizeof(struct hostent)); - memcpy(newreq->hostp, req->hostp, sizeof(struct hostent)); + newreq->hostp = g_malloc (sizeof (struct hostent)); + memcpy(newreq->hostp, req->hostp, sizeof (struct hostent)); newreq->host = req->host; newreq->curhost = req->curhost; #endif