pidgin: d1cb8f8d: Improved some of the debug output from n...

evands at pidgin.im evands at pidgin.im
Thu Mar 20 20:55:54 EDT 2008


-----------------------------------------------------------------
Revision: d1cb8f8d708a727ac0688ccbb562f411e438c635
Ancestor: ccf8998cb268f07fd8ef3f817b6cb5f1bc32cf02
Author: evands at pidgin.im
Date: 2008-03-21T00:52:51
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d1cb8f8d708a727ac0688ccbb562f411e438c635

Modified files:
        libpurple/nat-pmp.c

ChangeLog: 

Improved some of the debug output from nat-pmp

-------------- next part --------------
============================================================
--- libpurple/nat-pmp.c	e64e69ba27a98d5e20a196a4eb0a75846dcc6e50
+++ libpurple/nat-pmp.c	f56e00f82aabec30fe98b3af40d0d9f5e90322f1
@@ -182,7 +182,7 @@ default_gw()
 
     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 @@ default_gw()
 						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 @@ purple_pmp_create_map(PurplePmpType type
 	{
 		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 @@ purple_pmp_destroy_map(PurplePmpType typ
 	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;
 }


More information about the Commits mailing list