More work on removing old determinism-in-driver code
This commit is contained in:
@@ -56,7 +56,7 @@ static PADDRINFOA find_good_addr(PADDRINFOA addrinfo) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static SOCKET open_connection(std::string_view target, UmmString &err) {
|
||||
static SOCKET open_connection(std::string_view target, std::string &err) {
|
||||
PADDRINFOA addrs = nullptr;
|
||||
PADDRINFOA goodaddr = nullptr;
|
||||
SOCKET sock = INVALID_SOCKET;
|
||||
@@ -104,7 +104,7 @@ error:
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
SOCKET listen_on_port(int port, UmmString &err) {
|
||||
SOCKET listen_on_port(int port, std::string &err) {
|
||||
int status;
|
||||
err.clear();
|
||||
SOCKET sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
@@ -137,7 +137,7 @@ error:
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
static SOCKET accept_on_socket(SOCKET listen_socket, UmmString &err) {
|
||||
static SOCKET accept_on_socket(SOCKET listen_socket, std::string &err) {
|
||||
SOCKET chsock = accept(listen_socket, nullptr, nullptr);
|
||||
if (chsock != INVALID_SOCKET) {
|
||||
set_nonblocking(chsock);
|
||||
@@ -153,7 +153,7 @@ static SOCKET accept_on_socket(SOCKET listen_socket, UmmString &err) {
|
||||
}
|
||||
}
|
||||
|
||||
static int socket_send(SOCKET socket, const char *bytes, int nbytes, UmmString &err) {
|
||||
static int socket_send(SOCKET socket, const char *bytes, int nbytes, std::string &err) {
|
||||
err.clear();
|
||||
int wbytes = send(socket, bytes, nbytes, 0);
|
||||
if (wbytes == SOCKET_ERROR) {
|
||||
@@ -170,7 +170,7 @@ static int socket_send(SOCKET socket, const char *bytes, int nbytes, UmmString &
|
||||
}
|
||||
}
|
||||
|
||||
static int socket_recv(SOCKET socket, char *bytes, int nbytes, UmmString &err) {
|
||||
static int socket_recv(SOCKET socket, char *bytes, int nbytes, std::string &err) {
|
||||
err.clear();
|
||||
int nrecv = recv(socket, bytes, nbytes, 0);
|
||||
if (nrecv < 0) {
|
||||
@@ -192,7 +192,7 @@ static int socket_close(SOCKET socket) {
|
||||
return closesocket(socket);
|
||||
}
|
||||
|
||||
static int socket_poll(struct pollfd *pollvec, int pollcount, int mstimeout, UmmString &err) {
|
||||
static int socket_poll(struct pollfd *pollvec, int pollcount, int mstimeout, std::string &err) {
|
||||
int status = WSAPoll(pollvec, pollcount, mstimeout);
|
||||
if (status < 0) {
|
||||
err = winsock_error_string(WSAGetLastError());
|
||||
@@ -270,9 +270,8 @@ public:
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
allocate_buffers();
|
||||
init_winsock();
|
||||
chbuf.reset(new char[CHBUF_SIZE]);
|
||||
pollvec.reset(new struct pollfd[POLLVEC_SIZE]);
|
||||
OPENSSL_init_ssl(0, NULL);
|
||||
initialize_engine();
|
||||
driver_drive(argc, argv);
|
||||
|
||||
Reference in New Issue
Block a user