Debug output for all received messages.
FossilOrigin-Name: 2dd8b2aa490714135f764e512b87763425fe8a872f0816f3d1f4052d9f4557c4
This commit is contained in:
parent
a3064a77e3
commit
25a321ce5f
@ -6,6 +6,9 @@
|
||||
|
||||
#include "conn.h"
|
||||
#include "cwrmsg.h"
|
||||
#include "cw_log.h"
|
||||
#include "capwap.h"
|
||||
#include "sock.h"
|
||||
|
||||
struct args {
|
||||
struct conn *conn;
|
||||
@ -20,7 +23,8 @@ static int pmessage(void *p, struct cwrmsg * cwrmsg)
|
||||
|
||||
|
||||
memcpy(&conn->cwrmsg, cwrmsg, sizeof(struct cwrmsg));
|
||||
memcpy(conn->cwrmsg_buffer,cwrmsg->msgelems,cwrmsg->msgelems_len);
|
||||
memcpy(conn->cwrmsg_buffer, cwrmsg->msgelems,
|
||||
cwrmsg->msgelems_len);
|
||||
conn->cwrmsg.msgelems = conn->cwrmsg_buffer;
|
||||
args->cwrmsg = &conn->cwrmsg;
|
||||
return 0;
|
||||
@ -41,6 +45,16 @@ struct cwrmsg * conn_get_message(struct conn * conn)
|
||||
if (n > 0)
|
||||
conn_process_packet(conn, buf, n, pmessage, &args);
|
||||
|
||||
return args.cwrmsg;
|
||||
|
||||
if (args.cwrmsg) {
|
||||
|
||||
cw_dbg(DBG_CW_MSG,
|
||||
"Received message from %s, type=%d - %s, seq=%d",
|
||||
sock_addr2str(&conn->addr), args.cwrmsg->type,
|
||||
cw_msgtostr(args.cwrmsg->type),
|
||||
args.cwrmsg->seqnum);
|
||||
|
||||
}
|
||||
|
||||
return args.cwrmsg;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user