|
From: SourceForge.net <no...@so...> - 2005-03-20 02:06:39
|
Patches item #1162827, was opened at 2005-03-14 03:27 Message generated for change (Comment added) made by thekingant You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1162827&group_id=235 Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: rian hunter (chrono86) Assigned to: Mark Doliner (thekingant) Summary: 64bit IPC dns child bug Initial Comment: In proxy.c the dns child sends an int, size_t, an array of chars, (more size_ts, and char arrays), then an int. The problem with this protocol is that in 64 bit UNIX implementations, size_t is implemented as an 8 byte integer, whereas int is still 4 bytes. This conflicts with the while loop in the client function host_resolved: --- snip while(rc > 0) { rc=read(req->fd_out, &addrlen, sizeof(addrlen)); if(rc>0 && addrlen > 0) { addr=g_malloc(addrlen); rc=read(req->fd_out, addr, addrlen); hosts = g_slist_append(hosts, GINT_TO_POINTER(addrlen)); hosts = g_slist_append(hosts, addr); } else { break; } } -- snip The while loop depends on reading 8 bytes = 0 at a time to stop, but the dns child has been ending its request with only 4 bytes (the int). This patch declares a new constant in the gaim_dns_childthread function called "endzero" of type size_t (to match addrlen). The childthread now ends each dns request with endzero (8 bytes) instead of zero (4 bytes), so the client isn't waiting on the child forever. ---------------------------------------------------------------------- >Comment By: Mark Doliner (thekingant) Date: 2005-03-19 21:06 Message: Logged In: YES user_id=20979 I just fixed this in oldstatus (1.2.1) and head (2.0). I ending up changing zero from an int to a size_t. That should work, right? Thanks for tracking this down. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1162827&group_id=235 |