diff options
author | Volker Lendecke <vl@sernet.de> | 2008-09-03 12:52:29 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-09-03 13:52:13 +0200 |
commit | 29dd253e696f9a2f94fc13f408996eca9ede8a7d (patch) | |
tree | 7c6406e794fe0e8e950f7d4a6f0562964f54a09b /source3/rpc_client | |
parent | aac60fead2d3a07756c320ee09a0960252510c19 (diff) | |
download | samba-29dd253e696f9a2f94fc13f408996eca9ede8a7d.tar.gz samba-29dd253e696f9a2f94fc13f408996eca9ede8a7d.tar.bz2 samba-29dd253e696f9a2f94fc13f408996eca9ede8a7d.zip |
Tiny logic simplification: remove an else branch
(This used to be commit 9c4905ed6703a38ff72be5990a036d0a79aebb9f)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 69 |
1 files changed, 33 insertions, 36 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 41dde87c42..f32a33fdb6 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -1637,6 +1637,7 @@ NTSTATUS rpc_api_pipe_req(struct rpc_pipe_client *cli, uint16 frag_len = 0; uint8 flags = 0; uint32 ss_padding = 0; + ssize_t num_written; data_sent_thistime = calculate_data_len_tosend(cli, data_left, &frag_len, &auth_len, &ss_padding); @@ -1724,43 +1725,39 @@ NTSTATUS rpc_api_pipe_req(struct rpc_pipe_client *cli, } return ret; - } else { - /* More packets to come - write and continue. */ - ssize_t num_written; - - switch (cli->transport_type) { - case NCACN_NP: - num_written = cli_write(cli->trans.np.cli, - cli->trans.np.fnum, - 8, /* 8 means message mode. */ - prs_data_p(&outgoing_pdu), - (off_t)0, - (size_t)hdr.frag_len); - - if (num_written != hdr.frag_len) { - prs_mem_free(&outgoing_pdu); - return cli_get_nt_error( - cli->trans.np.cli); - } - break; - case NCACN_IP_TCP: - case NCACN_UNIX_STREAM: - num_written = write_data( - cli->trans.sock.fd, - prs_data_p(&outgoing_pdu), - (size_t)hdr.frag_len); - if (num_written != hdr.frag_len) { - NTSTATUS status; - status = map_nt_error_from_unix(errno); - prs_mem_free(&outgoing_pdu); - return status; - } - break; - default: - DEBUG(0, ("unknown transport type %d\n", - cli->transport_type)); - return NT_STATUS_INTERNAL_ERROR; + } + + switch (cli->transport_type) { + case NCACN_NP: + num_written = cli_write(cli->trans.np.cli, + cli->trans.np.fnum, + 8, /* 8 means message mode. */ + prs_data_p(&outgoing_pdu), + (off_t)0, + (size_t)hdr.frag_len); + + if (num_written != hdr.frag_len) { + prs_mem_free(&outgoing_pdu); + return cli_get_nt_error(cli->trans.np.cli); } + break; + case NCACN_IP_TCP: + case NCACN_UNIX_STREAM: + num_written = write_data( + cli->trans.sock.fd, + prs_data_p(&outgoing_pdu), + (size_t)hdr.frag_len); + if (num_written != hdr.frag_len) { + NTSTATUS status; + status = map_nt_error_from_unix(errno); + prs_mem_free(&outgoing_pdu); + return status; + } + break; + default: + DEBUG(0, ("unknown transport type %d\n", + cli->transport_type)); + return NT_STATUS_INTERNAL_ERROR; } current_data_offset += data_sent_thistime; |