Problem: s_send(more) can be replaced by safer send_string_expect_success

Solution: remove s_send(more) and replace all uses
This commit is contained in:
Simon Giesecke
2019-03-24 13:02:50 -04:00
parent af4fa22fd8
commit 34999d5069
11 changed files with 65 additions and 79 deletions

View File

@@ -82,20 +82,20 @@ static void zap_handler (void *handler_)
TEST_ASSERT_EQUAL_STRING ("1.0", version);
TEST_ASSERT_EQUAL_STRING ("GSSAPI", mechanism);
s_sendmore (handler_, version);
s_sendmore (handler_, sequence);
send_string_expect_success (handler_, version, ZMQ_SNDMORE);
send_string_expect_success (handler_, sequence, ZMQ_SNDMORE);
if (!zap_deny_all) {
s_sendmore (handler_, "200");
s_sendmore (handler_, "OK");
s_sendmore (handler_, "anonymous");
s_send (handler_, "");
send_string_expect_success (handler_, "200", ZMQ_SNDMORE);
send_string_expect_success (handler_, "OK", ZMQ_SNDMORE);
send_string_expect_success (handler_, "anonymous", ZMQ_SNDMORE);
send_string_expect_success (handler_, "", 0);
//fprintf (stderr, "ALLOW %s\n", principal);
} else {
s_sendmore (handler_, "400");
s_sendmore (handler_, "Denied");
s_sendmore (handler_, "");
s_send (handler_, "");
send_string_expect_success (handler_, "400", ZMQ_SNDMORE);
send_string_expect_success (handler_, "Denied", ZMQ_SNDMORE);
send_string_expect_success (handler_, "", ZMQ_SNDMORE);
send_string_expect_success (handler_, "", 0);
//fprintf (stderr, "DENY %s\n", principal);
}
free (version);