*****************************************************************************/
struct aio_extra {
+ uint64_t mid;
files_struct *fsp;
struct smb_request *smbreq;
DATA_BLOB outbuf;
{
struct aio_extra *aio_ex = tevent_req_callback_data(
req, struct aio_extra);
+ struct smb_request *smbreq = NULL;
files_struct *fsp = aio_ex->fsp;
size_t outsize;
char *outbuf = (char *)aio_ex->outbuf.data;
return;
}
+ smbreq = talloc_move(talloc_tos(), &aio_ex->smbreq);
+ smbreq->outbuf = (char *)talloc_move(smbreq, &aio_ex->outbuf.data);
+
if (nread < 0) {
DEBUG( 3, ("handle_aio_read_complete: file %s nread == %d. "
"Error = %s\n", fsp_str_dbg(fsp), (int)nread,
_smb_setlen_large(outbuf, outsize);
show_msg(outbuf);
- if (!srv_send_smb(aio_ex->smbreq->xconn, outbuf,
- true, aio_ex->smbreq->seqnum+1,
- IS_CONN_ENCRYPTED(fsp->conn), NULL)) {
- exit_server_cleanly("handle_aio_read_complete: srv_send_smb "
- "failed.");
- }
DEBUG(10, ("handle_aio_read_complete: scheduled aio_read completed "
"for file %s, offset %.0f, len = %u\n",
(unsigned int)nread));
TALLOC_FREE(aio_ex);
+
+ smb_request_done(smbreq);
}
struct pwrite_fsync_state {
{
struct aio_extra *aio_ex = tevent_req_callback_data(
req, struct aio_extra);
+ struct smb_request *smbreq = NULL;
files_struct *fsp = aio_ex->fsp;
char *outbuf = (char *)aio_ex->outbuf.data;
ssize_t numtowrite = aio_ex->nbyte;
return;
}
+ smbreq = talloc_move(talloc_tos(), &aio_ex->smbreq);
+ smbreq->outbuf = (char *)talloc_move(smbreq, &aio_ex->outbuf.data);
+
/* We don't need outsize or set_message here as we've already set the
fixed size length when we set up the aio call. */
}
show_msg(outbuf);
- if (!srv_send_smb(aio_ex->smbreq->xconn, outbuf,
- true, aio_ex->smbreq->seqnum+1,
- IS_CONN_ENCRYPTED(fsp->conn),
- NULL)) {
- exit_server_cleanly("handle_aio_write_complete: "
- "srv_send_smb failed.");
- }
DEBUG(10, ("handle_aio_write_complete: scheduled aio_write completed "
"for file %s, offset %.0f, requested %u, written = %u\n",
(unsigned int)numtowrite, (unsigned int)nwritten));
TALLOC_FREE(aio_ex);
+
+ smb_request_done(smbreq);
}
bool cancel_smb2_aio(struct smb_request *smbreq)