Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
💰 bribe compiler w/ NanThrowError return
Browse files Browse the repository at this point in the history
• PR: #413
• corrects the control flow issue missed in PR: #401
  • Loading branch information
reqshark committed Apr 3, 2015
1 parent f95d869 commit 0c3d024
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,10 @@ namespace zmq {

void
Socket::UV_PollCallback(uv_poll_t* handle, int status, int events) {
if (status != 0) NanThrowError("I/O status: socket not ready !=0 ");
if (status != 0) {
NanThrowError("I/O status: socket not ready !=0 ");
return;
}
Socket* s = static_cast<Socket*>(handle->data);
s->CallbackIfReady();
}
Expand Down Expand Up @@ -439,9 +442,14 @@ namespace zmq {

// get our next frame it may have the target address and safely copy to our buffer
zmq_msg_init (&msg2);
if (zmq_msg_more(&msg1) == 0) NanThrowError(ExceptionFromError());
if (zmq_recvmsg (s->monitor_socket_, &msg2, 0) == -1)
if (zmq_msg_more(&msg1) == 0) {
NanThrowError(ExceptionFromError());
return;
}
if (zmq_recvmsg (s->monitor_socket_, &msg2, 0) == -1) {
NanThrowError(ExceptionFromError());
return;
}
// protect from overflow
size_t len = zmq_msg_size(&msg2);
// MIN message size and buffer size with null padding
Expand Down

0 comments on commit 0c3d024

Please sign in to comment.