From 5c620048e30e1820d688084a83163f2fe6d1a63a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 9 Nov 2005 13:42:56 +0000 Subject: r11607: switched the smb server to use the generic packet send code (This used to be commit 9eee7bafa12553a894536db8ce5cc2d268e09ae6) --- source4/smb_server/smb_server.c | 44 +++-------------------------------------- 1 file changed, 3 insertions(+), 41 deletions(-) (limited to 'source4/smb_server/smb_server.c') diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c index 0cdc2dc7e4..6d2ffc0274 100644 --- a/source4/smb_server/smb_server.c +++ b/source4/smb_server/smb_server.c @@ -620,47 +620,9 @@ static void smbsrv_recv(struct stream_connection *conn, uint16_t flags) */ static void smbsrv_send(struct stream_connection *conn, uint16_t flags) { - struct smbsrv_connection *smb_conn = talloc_get_type(conn->private, struct smbsrv_connection); - - while (smb_conn->pending_send) { - struct smbsrv_request *req = smb_conn->pending_send; - DATA_BLOB blob; - NTSTATUS status; - size_t sendlen; - - blob.data = req->out.buffer; - blob.length = req->out.size; - - /* send as much of this request as we can */ - status = socket_send(conn->socket, &blob, &sendlen, 0); - if (NT_STATUS_IS_ERR(status)) { - smbsrv_terminate_connection(req->smb_conn, nt_errstr(status)); - break; - } - if (sendlen == 0) { - break; - } - - req->out.buffer += sendlen; - req->out.size -= sendlen; - - /* is the whole request gone? */ - if (req->out.size == 0) { - DLIST_REMOVE(smb_conn->pending_send, req); - req_destroy(req); - } - } - - if (smb_conn->terminate) { - stream_terminate_connection(smb_conn->connection, smb_conn->terminate); - return; - } - - /* if no more requests are pending to be sent then - we should stop select for write */ - if (smb_conn->pending_send == NULL) { - EVENT_FD_NOT_WRITEABLE(conn->event.fde); - } + struct smbsrv_connection *smb_conn = talloc_get_type(conn->private, + struct smbsrv_connection); + packet_queue_run(smb_conn->packet); } -- cgit