s4-dns: dlz_bind9: Fix ipv6 updates
[samba.git] / source3 / torture / test_async_echo.c
index 3fdf1d541b199778f5d49679754d477e717e6c50..f21daa4485cd18453a3bdb8b349f1b66c514e8b7 100644 (file)
@@ -46,7 +46,7 @@ static void cli_echo_done(struct tevent_req *req)
        *done -= 1;
 }
 
-static void cli_close_done(struct tevent_req *req)
+static void write_andx_done(struct tevent_req *req)
 {
        int *done = (int *)tevent_req_callback_data_void(req);
        NTSTATUS status;
@@ -54,7 +54,7 @@ static void cli_close_done(struct tevent_req *req)
 
        status = cli_write_andx_recv(req, &written);
        TALLOC_FREE(req);
-       printf("close returned %s\n", nt_errstr(status));
+       printf("cli_write_andx returned %s\n", nt_errstr(status));
        *done -= 1;
 }
 
@@ -68,11 +68,11 @@ bool run_async_echo(int dummy)
        NTSTATUS status;
        bool ret = false;
        int i, num_reqs;
-       uint8_t buf[32768];
+       uint8_t buf[65536];
 
        printf("Starting ASYNC_ECHO\n");
 
-       ev = tevent_context_init(talloc_tos());
+       ev = samba_tevent_context_init(talloc_tos());
        if (ev == NULL) {
                printf("tevent_context_init failed\n");
                goto fail;
@@ -82,7 +82,7 @@ bool run_async_echo(int dummy)
                printf("torture_open_connection failed\n");
                goto fail;
        }
-       status = cli_rpc_pipe_open_noauth(cli, &ndr_table_rpcecho.syntax_id,
+       status = cli_rpc_pipe_open_noauth(cli, &ndr_table_rpcecho,
                                          &p);
        if (!NT_STATUS_IS_OK(status)) {
                printf("Could not open echo pipe: %s\n", nt_errstr(status));
@@ -111,15 +111,17 @@ bool run_async_echo(int dummy)
        memset(buf, 0, sizeof(buf));
 
        for (i=0; i<10; i++) {
-               req = cli_write_andx_send(ev, ev, cli, 4711, 0, buf, 0, sizeof(buf));
+               req = cli_write_andx_send(ev, ev, cli, 4711, 0, buf, 0,
+                                         sizeof(buf));
                if (req == NULL) {
                        printf("cli_write_andx_send failed\n");
                        goto fail;
                }
-               tevent_req_set_callback(req, cli_close_done, &num_reqs);
+               tevent_req_set_callback(req, write_andx_done, &num_reqs);
                num_reqs += 1;
 
-               req = cli_echo_send(ev, ev, cli, 1, data_blob_const("hello", 5));
+               req = cli_echo_send(ev, ev, cli, 1,
+                                   data_blob_const("hello", 5));
                if (req == NULL) {
                        printf("cli_echo_send failed\n");
                        goto fail;