s3:libsmb: make use of cli_state_receive_next() in cli_smb_received()
authorStefan Metzmacher <metze@samba.org>
Thu, 11 Aug 2011 10:28:06 +0000 (12:28 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 12 Aug 2011 09:08:00 +0000 (11:08 +0200)
metze

source3/libsmb/async_smb.c

index 2744f8135a51d8490b92d510d89991390f1ffdff..2c053421dd5f90017b72cf6991a321b9ae6342f4 100644 (file)
@@ -719,23 +719,8 @@ static void cli_smb_received(struct tevent_req *subreq)
  done:
        TALLOC_FREE(frame);
 
-       if ((talloc_array_length(cli->conn.pending) > 0) &&
-           (cli->conn.read_smb_req == NULL)) {
-               /*
-                * Set up another read request for the other pending cli_smb
-                * requests
-                */
-               state = tevent_req_data(cli->conn.pending[0],
-                                       struct cli_smb_state);
-               cli->conn.read_smb_req = read_smb_send(
-                       cli->conn.pending, state->ev, cli->conn.fd);
-               if (cli->conn.read_smb_req == NULL) {
-                       status = NT_STATUS_NO_MEMORY;
-                       cli_state_notify_pending(cli, status);
-                       return;
-               }
-               tevent_req_set_callback(cli->conn.read_smb_req,
-                                       cli_smb_received, cli);
+       if (!cli_state_receive_next(cli)) {
+               cli_state_notify_pending(cli, NT_STATUS_NO_MEMORY);
        }
 }