diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-28 05:09:42 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:04:52 -0500 |
commit | aa19318fd513fb4d6a36793b96fb7ffa66622d6f (patch) | |
tree | 6ec045ea70e727e3c95489a5230d00d36c0b4c9d /source4/smb_server/request.c | |
parent | d668ec53b355de04f45279f14906ab5af116183e (diff) | |
download | samba-aa19318fd513fb4d6a36793b96fb7ffa66622d6f.tar.gz samba-aa19318fd513fb4d6a36793b96fb7ffa66622d6f.tar.bz2 samba-aa19318fd513fb4d6a36793b96fb7ffa66622d6f.zip |
r3307: fixed the send side of the smb_server code to be non-blocking. This
means the whole of the SMB handling code is now non-blocking.
(This used to be commit 30acedb943f0170d30e7b08925280d0dffc7873e)
Diffstat (limited to 'source4/smb_server/request.c')
-rw-r--r-- | source4/smb_server/request.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/source4/smb_server/request.c b/source4/smb_server/request.c index 4ca9c9ffda..3095d0b70c 100644 --- a/source4/smb_server/request.c +++ b/source4/smb_server/request.c @@ -241,24 +241,16 @@ void req_grow_data(struct smbsrv_request *req, uint_t new_size) */ void req_send_reply_nosign(struct smbsrv_request *req) { - NTSTATUS status; - DATA_BLOB tmp_blob; - size_t sendlen; - if (req->out.size > NBT_HDR_SIZE) { _smb_setlen(req->out.buffer, req->out.size - NBT_HDR_SIZE); } - tmp_blob.data = req->out.buffer; - tmp_blob.length = req->out.size; - - status = socket_send(req->smb_conn->connection->socket, &tmp_blob, &sendlen, SOCKET_FLAG_BLOCK); - if (!NT_STATUS_IS_OK(status) || (req->out.size != sendlen)) { - smbsrv_terminate_connection(req->smb_conn, "failed to send reply\n"); - return; - } + /* add the request to the list of requests that need to be + sent to the client, then mark the socket event structure + ready for write events */ + DLIST_ADD_END(req->smb_conn->pending_send, req, struct smbsrv_request *); - req_destroy(req); + req->smb_conn->connection->event.fde->flags |= EVENT_FD_WRITE; } /* |