*/
static void smb_read_callback(struct smbcli_request *req)
{
+ struct dcecli_connection *c;
struct smb_private *smb;
struct smb_read_state *state;
union smb_read *io;
state = talloc_get_type(req->async.private_data, struct smb_read_state);
smb = talloc_get_type(state->c->transport.private_data, struct smb_private);
io = state->io;
+ c = state->c;
status = smb_raw_read_recv(state->req, io);
if (NT_STATUS_IS_ERR(status)) {
- pipe_dead(state->c, status);
talloc_free(state);
+ pipe_dead(c, status);
return;
}
if (state->received < 16) {
DEBUG(0,("dcerpc_smb: short packet (length %d) in read callback!\n",
(int)state->received));
- pipe_dead(state->c, NT_STATUS_INFO_LENGTH_MISMATCH);
talloc_free(state);
+ pipe_dead(c, NT_STATUS_INFO_LENGTH_MISMATCH);
return;
}
if (frag_length <= state->received) {
DATA_BLOB data = state->data;
- struct dcecli_connection *c = state->c;
data.length = state->received;
talloc_steal(state->c, data.data);
talloc_free(state);
state->req = smb_raw_read_send(smb->tree, io);
if (state->req == NULL) {
- pipe_dead(state->c, NT_STATUS_NO_MEMORY);
talloc_free(state);
+ pipe_dead(c, NT_STATUS_NO_MEMORY);
return;
}
struct smb_trans_state *state;
uint16_t max_data;
- state = talloc(smb, struct smb_trans_state);
+ state = talloc(c, struct smb_trans_state);
if (state == NULL) {
return NT_STATUS_NO_MEMORY;
}
*/
static void smb2_read_callback(struct smb2_request *req)
{
+ struct dcecli_connection *c;
struct smb2_private *smb;
struct smb2_read_state *state;
struct smb2_read io;
state = talloc_get_type(req->async.private_data, struct smb2_read_state);
smb = talloc_get_type(state->c->transport.private_data, struct smb2_private);
+ c = state->c;
status = smb2_read_recv(req, state, &io);
if (NT_STATUS_IS_ERR(status)) {
- pipe_dead(state->c, status);
talloc_free(state);
+ pipe_dead(c, status);
return;
}
if (!data_blob_append(state, &state->data,
io.out.data.data, io.out.data.length)) {
- pipe_dead(state->c, NT_STATUS_NO_MEMORY);
talloc_free(state);
+ pipe_dead(c, NT_STATUS_NO_MEMORY);
return;
}
if (state->data.length < 16) {
DEBUG(0,("dcerpc_smb2: short packet (length %d) in read callback!\n",
(int)state->data.length));
- pipe_dead(state->c, NT_STATUS_INFO_LENGTH_MISMATCH);
talloc_free(state);
+ pipe_dead(c, NT_STATUS_INFO_LENGTH_MISMATCH);
return;
}
if (frag_length <= state->data.length) {
DATA_BLOB data = state->data;
- struct dcecli_connection *c = state->c;
talloc_steal(c, data.data);
talloc_free(state);
c->transport.recv_data(c, &data, NT_STATUS_OK);
req = smb2_read_send(smb->tree, &io);
if (req == NULL) {
- pipe_dead(state->c, NT_STATUS_NO_MEMORY);
talloc_free(state);
+ pipe_dead(c, NT_STATUS_NO_MEMORY);
return;
}
struct smb2_read_state *state;
struct smb2_request *req;
- state = talloc(smb, struct smb2_read_state);
+ state = talloc(c, struct smb2_read_state);
if (state == NULL) {
return NT_STATUS_NO_MEMORY;
}