Ensure that any messages are being forwarded even on success packet

This commit is contained in:
Nikos Mavrogiannopoulos
2015-02-19 11:47:20 +01:00
parent 51ab9a97d0
commit daa18cae8d
2 changed files with 9 additions and 1 deletions
+4
View File
@@ -123,6 +123,10 @@ int send_sec_auth_reply(int cfd, sec_mod_st * sec, client_entry_st * entry, AUTH
msg.user_name = entry->username;
if (entry->msg_str[0] != 0) {
msg.msg = entry->msg_str;
}
msg.has_sid = 1;
msg.sid.data = entry->sid;
msg.sid.len = sizeof(entry->sid);
+5 -1
View File
@@ -713,6 +713,8 @@ static int recv_auth_reply(worker_st * ws, int sd, char *txt,
oclog(ws, LOG_DEBUG, "received auth reply message (value: %u)",
(unsigned)msg->reply);
if (txt) txt[0] = 0;
switch (msg->reply) {
case AUTH__REP__MSG:
if (txt == NULL || msg->msg == NULL) {
@@ -759,6 +761,9 @@ static int recv_auth_reply(worker_st * ws, int sd, char *txt,
memcpy(ws->session_id, msg->dtls_session_id.data,
msg->dtls_session_id.len);
if (msg->msg && txt)
strlcpy(txt, msg->msg, max_txt_size);
break;
case AUTH__REP__FAILED:
default:
@@ -1323,7 +1328,6 @@ int post_auth_handler(worker_st * ws, unsigned http_ver)
goto auth_fail;
}
msg[0] = 0;
ret = recv_auth_reply(ws, sd, msg, sizeof(msg));
if (sd != -1) {
close(sd);