C++ std::getline在SSL函数调用后失败

C++ std::getline在SSL函数调用后失败,c++,ssl,cin,getline,C++,Ssl,Cin,Getline,调用某些SSL函数后,我的getlineread循环已停止读取输入。以前我有: std::string input; ... while (std::getline(std::cin, line)) { ... } 这很有效。但是在我用SSL包装套接字之后,不再读取来自控制台的输入 SSL* ssl_fd = SSL_new(ctx); if (NULL == ssl_fd) { close(new_fd); continue; } if (0 == SSL_set_fd(ss

调用某些SSL函数后,我的
getline
read循环已停止读取输入。以前我有:

std::string input;
...

while (std::getline(std::cin, line)) {
  ...
}
这很有效。但是在我用SSL包装套接字之后,不再读取来自控制台的输入

SSL* ssl_fd = SSL_new(ctx);
if (NULL == ssl_fd) {
  close(new_fd);
  continue;
}

if (0 == SSL_set_fd(ssl_fd, new_fd)) {
  close(new_fd);
  continue;
}

if (1 != SSL_accept(ssl_fd)) {
  ERR_print_errors_fp(stderr);
  close(new_fd);
  continue;
}

while (std::getline(std::cin, line)) {
  ...
}

我尝试添加一些调用来清除任何缓冲区问题(
std::cout Wrapped what socket?您不能提供完整的测试用例吗?您在刚才注册时就知道了所有这些。我怀疑您获得该socket的代码正在破坏您的堆栈。请通过valgrind发送此消息。