diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-11-09 13:42:56 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:45:58 -0500 |
commit | 5c620048e30e1820d688084a83163f2fe6d1a63a (patch) | |
tree | d20ddbee5268cf6efefbee0693393d9e23a35980 /source4/smb_server/request.c | |
parent | dce04d193eb0d195eb000c766921c51260d65f0e (diff) | |
download | samba-5c620048e30e1820d688084a83163f2fe6d1a63a.tar.gz samba-5c620048e30e1820d688084a83163f2fe6d1a63a.tar.bz2 samba-5c620048e30e1820d688084a83163f2fe6d1a63a.zip |
r11607: switched the smb server to use the generic packet send code
(This used to be commit 9eee7bafa12553a894536db8ce5cc2d268e09ae6)
Diffstat (limited to 'source4/smb_server/request.c')
-rw-r--r-- | source4/smb_server/request.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source4/smb_server/request.c b/source4/smb_server/request.c index 93d9a160f3..5491089c8e 100644 --- a/source4/smb_server/request.c +++ b/source4/smb_server/request.c @@ -27,6 +27,7 @@ #include "dlinklist.h" #include "smb_server/smb_server.h" #include "smbd/service_stream.h" +#include "lib/stream/packet.h" /* we over allocate the data buffer to prevent too many realloc calls */ @@ -291,16 +292,19 @@ void req_grow_data(struct smbsrv_request *req, uint_t new_size) */ void req_send_reply_nosign(struct smbsrv_request *req) { + DATA_BLOB blob; + NTSTATUS status; + if (req->out.size > NBT_HDR_SIZE) { _smb_setlen(req->out.buffer, req->out.size - NBT_HDR_SIZE); } - /* 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 *); - - EVENT_FD_WRITEABLE(req->smb_conn->connection->event.fde); + blob = data_blob_const(req->out.buffer, req->out.size); + status = packet_send(req->smb_conn->packet, blob); + if (!NT_STATUS_IS_OK(status)) { + smbsrv_terminate_connection(req->smb_conn, nt_errstr(status)); + } + req_destroy(req); } /* |