c++ - std::getline fails after SSL function calls -
my getline
read loop has stopped reading input after calls ssl functions. had:
std::string input; ... while (std::getline(std::cin, line)) { ... }
this worked fine. after wrapped socket ssl, input console no longer being read.
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)) { ... }
i've tried adding calls clear buffer issues (std::cout << std::flush
, std::cin.ignore()
, std::cin.clear()
), @ point i'm out of ideas. it's weird; if take out ssl calls, read loop runs fine , processes input correctly. far can tell, ssl calls don't have impact on stdin or stdout.
any recommendations or alternate approaches try?
Comments
Post a Comment