Skip to content

Commit

Permalink
Partial fix for issue 2963, removed invalid casts from fd_t to int (#…
Browse files Browse the repository at this point in the history
…2984)

* Fixes issue 2963, ref stream_engine.cpp:981

* Fixes issue 2963, ref socks_connecter.cpp:158

* Fixes issue 2963, ref tcp_listener.cpp:144

* Fixes issue 2963, ref tcp_connecter.cpp:423

* Fixes issue 2963, ref socks_connecter.cpp:436

* Fixes issue 2963, ref tcp_listener.cpp:179

* Fixes issue 2963, ref tcp_listener.cpp:268

* Fixes issue 2963, ref tcp_connecter.cpp:160
  • Loading branch information
kachanovskiy authored and sigiesec committed Mar 12, 2018
1 parent 7bce4ff commit 9c748f1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/socks_connecter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void zmq::socks_connecter_t::in_event ()
// Attach the engine to the corresponding session object.
send_attach (session, engine);

socket->event_connected (endpoint, (int) s);
socket->event_connected (endpoint, s);

rm_fd (handle);
s = -1;
Expand Down Expand Up @@ -444,7 +444,7 @@ void zmq::socks_connecter_t::close ()
const int rc = ::close (s);
errno_assert (rc == 0);
#endif
socket->event_closed (endpoint, (int) s);
socket->event_closed (endpoint, s);
s = retired_fd;
}

Expand Down
2 changes: 1 addition & 1 deletion src/stream_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ void zmq::stream_engine_t::error (error_reason_t reason)
socket->event_handshake_failed_no_detail (endpoint, err);
}
#endif
socket->event_disconnected (endpoint, (int) s);
socket->event_disconnected (endpoint, s);
session->flush ();
session->engine_error (reason);
unplug ();
Expand Down
4 changes: 2 additions & 2 deletions src/tcp_connecter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void zmq::tcp_connecter_t::out_event ()
// Shut the connecter down.
terminate ();

socket->event_connected (endpoint, (int) fd);
socket->event_connected (endpoint, fd);
}

void zmq::tcp_connecter_t::rm_handle ()
Expand Down Expand Up @@ -435,6 +435,6 @@ void zmq::tcp_connecter_t::close ()
const int rc = ::close (s);
errno_assert (rc == 0);
#endif
socket->event_closed (endpoint, (int) s);
socket->event_closed (endpoint, s);
s = retired_fd;
}
6 changes: 3 additions & 3 deletions src/tcp_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void zmq::tcp_listener_t::close ()
int rc = ::close (s);
errno_assert (rc == 0);
#endif
socket->event_closed (endpoint, (int) s);
socket->event_closed (endpoint, s);
s = retired_fd;
}

Expand Down Expand Up @@ -179,7 +179,7 @@ int zmq::tcp_listener_t::set_address (const char *addr_)

if (options.use_fd != -1) {
s = options.use_fd;
socket->event_listening (endpoint, (int) s);
socket->event_listening (endpoint, s);
return 0;
}

Expand Down Expand Up @@ -275,7 +275,7 @@ int zmq::tcp_listener_t::set_address (const char *addr_)
goto error;
#endif

socket->event_listening (endpoint, (int) s);
socket->event_listening (endpoint, s);
return 0;

error:
Expand Down

0 comments on commit 9c748f1

Please sign in to comment.