char buf[12];
int ret;
TALLOC_CTX *frame = talloc_stackframe();
+ int fds[1] = { 0 };
+ NTSTATUS status;
smb_init_locale();
messaging_register(msg_ctx, NULL, MSG_PONG, pong_message);
for (i=0;i<n;i++) {
- messaging_send(msg_ctx, pid_to_procid(pid), MSG_PING,
- &data_blob_null);
+ status = messaging_send(msg_ctx, pid_to_procid(pid), MSG_PING,
+ &data_blob_null);
+ if (!NT_STATUS_IS_OK(status)) {
+ fprintf(stderr, "%s:%s: error: %s\n",
+ __location__, __func__,
+ nt_errstr(status));
+ TALLOC_FREE(frame);
+ exit(1);
+ }
+ status = messaging_send_iov(msg_ctx, pid_to_procid(pid),
+ MSG_PING, NULL, 0, fds, 1);
+ if (!NT_STATUS_IS_OK(status)) {
+ fprintf(stderr, "%s:%s: error: %s\n",
+ __location__, __func__,
+ nt_errstr(status));
+ TALLOC_FREE(frame);
+ exit(1);
+ }
}
while (pong_count < i) {
strlcpy(buf, "1234567890", sizeof(buf));
for (i=0;i<n;i++) {
- messaging_send(msg_ctx, messaging_server_id(msg_ctx), MSG_PING,
- &data_blob_null);
- messaging_send_buf(msg_ctx, messaging_server_id(msg_ctx),
- MSG_PING,(uint8_t *)buf, 11);
+ status = messaging_send(msg_ctx, messaging_server_id(msg_ctx),
+ MSG_PING, &data_blob_null);
+ if (!NT_STATUS_IS_OK(status)) {
+ fprintf(stderr, "%s:%s: error: %s\n",
+ __location__, __func__,
+ nt_errstr(status));
+ TALLOC_FREE(frame);
+ exit(1);
+ }
+ status = messaging_send_buf(msg_ctx, messaging_server_id(msg_ctx),
+ MSG_PING, (uint8_t *)buf, 11);
+ if (!NT_STATUS_IS_OK(status)) {
+ fprintf(stderr, "%s:%s: error: %s\n",
+ __location__, __func__,
+ nt_errstr(status));
+ TALLOC_FREE(frame);
+ exit(1);
+ }
}
/*
msg_ctx, pid_to_procid(pid),
MSG_PING, &data_blob_null)))
ping_count++;
+ if(NT_STATUS_IS_OK(messaging_send_iov(
+ msg_ctx, pid_to_procid(pid),
+ MSG_PING, NULL, 0, fds, 1)))
+ ping_count++;
while (ping_count > pong_count + 20) {
ret = tevent_loop_once(evt_ctx);