Close #33 增加HTTP Upgrade透明转发的功能

This commit is contained in:
Lu Qiuwen
2018-10-24 15:40:26 +08:00
parent c53641bc27
commit 62b8089166
4 changed files with 28 additions and 5 deletions

View File

@@ -236,8 +236,15 @@ void __kni_event_cb(evutil_socket_t fd, short what, void * user)
__cmsghdr = CMSG_FIRSTHDR(&__msghdr);
__fds = (int *) (CMSG_DATA(__cmsghdr));
if(__kni_parse_tlv_data(__ctx, &__accept_para, __buffer, (size_t)rd) < 0)
if (unlikely(__fds == NULL))
{
TFE_LOG_ERROR(__ctx->logger, "Failed at fetch CMSG_DATA() from incoming fds, close KNI connection.");
goto __close_kni_connection;
}
if(unlikely(__kni_parse_tlv_data(__ctx, &__accept_para, __buffer, (size_t)rd) < 0))
{
TFE_LOG_ERROR(__ctx->logger, "Failed at parsing TLV format, close KNI connection.");
goto __close_kni_connection;
}