Browse Source

Bugfix: RPC: Use the same mcast code in reply, and log it correctly

Luke Dashjr 12 years ago
parent
commit
5a8e62ead3
1 changed files with 3 additions and 3 deletions
  1. 3 3
      api.c

+ 3 - 3
api.c

@@ -4311,7 +4311,6 @@ static void mcast()
 	char *expect_code;
 	size_t expect_code_len;
 	char buf[1024];
-	char reply[] = "cgm-" API_MCAST_CODE "-"; // constant
 	char replybuf[1024];
 
 	memset(&grp, 0, sizeof(grp));
@@ -4404,7 +4403,8 @@ static void mcast()
 				reply_sock = socket(AF_INET, SOCK_DGRAM, 0);
 
 				snprintf(replybuf, sizeof(replybuf),
-							"cgm-" API_MCAST_CODE "-%d",
+							"cgm-%s-%d",
+							opt_api_mcast_code,
 							opt_api_port);
 
 				rep = sendto(reply_sock, replybuf, strlen(replybuf)+1,
@@ -4415,7 +4415,7 @@ static void mcast()
 								SOCKERRMSG, (int)reply_sock);
 				} else {
 					applog(LOG_DEBUG, "API mcast reply (%s) succeeded (%d) (%d)",
-								reply, (int)rep, (int)reply_sock);
+								replybuf, (int)rep, (int)reply_sock);
 				}
 
 				CLOSESOCKET(reply_sock);