Skip to content

Commit

Permalink
nopoll:
Browse files Browse the repository at this point in the history
* [fix] Updated nopoll_conn_send_ping to flag "masked" according
  to role. Reported by https://github.com/jackyzy823
  aabad7f#commitcomment-23612032
  • Loading branch information
francisbrosnan committed Aug 12, 2017
1 parent ffc78bf commit 0684c85
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/nopoll_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -3982,7 +3982,11 @@ int nopoll_conn_read_pending (noPollConn * conn) {
*/
nopoll_bool nopoll_conn_send_ping (noPollConn * conn)
{
return nopoll_conn_send_frame (conn, nopoll_true, nopoll_true, NOPOLL_PING_FRAME, 0, NULL, 0) >= 0;
/* check input parameter to allow role check */
if (conn == NULL)
return nopoll_false;

return nopoll_conn_send_frame (conn, nopoll_true, conn->role == NOPOLL_ROLE_CLIENT, NOPOLL_PING_FRAME, 0, NULL, 0) >= 0;
}

/**
Expand Down

0 comments on commit 0684c85

Please sign in to comment.