# HG changeset patch # User Evan Schoenberg # Date 1206060771 0 # Node ID 8972581c2326971bd679098cdf62eaab114bab06 # Parent 49deb72ffdc11f61d576770f582c0cfdfebfc69d Improved some of the debug output from nat-pmp diff -r 49deb72ffdc1 -r 8972581c2326 libpurple/nat-pmp.c --- a/libpurple/nat-pmp.c Thu Mar 20 08:42:15 2008 +0000 +++ b/libpurple/nat-pmp.c Fri Mar 21 00:52:51 2008 +0000 @@ -182,7 +182,7 @@ if (!(buf = malloc(needed))) { - purple_debug_warning("nat-pmp", "malloc\n"); + purple_debug_warning("nat-pmp", "Failed to malloc %i\n", needed); return NULL; } @@ -232,7 +232,7 @@ sin->sin_addr.s_addr = rti_sin->sin_addr.s_addr; memcpy(sin, rti_info[RTAX_GATEWAY], sizeof(struct sockaddr_in)); - purple_debug_info("nat-pmp", "found a default gateway\n"); + purple_debug_info("nat-pmp", "Found a default gateway\n"); found = TRUE; break; } @@ -455,7 +455,8 @@ { success = (resp->opcode == (req.opcode + 128)); if (!success) - purple_debug_info("nat-pmp", "The opcode for the response from the NAT device does not match the request opcode!\n"); + purple_debug_info("nat-pmp", "The opcode for the response from the NAT device (%i) does not match the request opcode (%i + 128 = %i)!\n", + resp->opcode, req.opcode, req.opcode + 128); } #ifdef PMP_DEBUG @@ -492,7 +493,8 @@ success = purple_pmp_create_map(((type == PURPLE_PMP_TYPE_UDP) ? PMP_MAP_OPCODE_UDP : PMP_MAP_OPCODE_TCP), privateport, 0, 0); if (!success) - purple_debug_warning("nat-pmp", "Failed to properly destroy mapping for %d!\n", privateport); + purple_debug_warning("nat-pmp", "Failed to properly destroy mapping for %s port %d!\n", + ((type == PURPLE_PMP_TYPE_UDP) ? "UDP" : "TCP"), privateport); return success; }