summaryrefslogtreecommitdiff
path: root/source4/smb_server/request.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-06-29 07:40:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:49 -0500
commit118f3edd27f5adacc1da636ed05b33f04999584f (patch)
treeb4b314537144d48820589e925c4e3fb08f293ee5 /source4/smb_server/request.c
parentb87fa55bdc69fe50743ddb58977e408853abb4cb (diff)
downloadsamba-118f3edd27f5adacc1da636ed05b33f04999584f.tar.gz
samba-118f3edd27f5adacc1da636ed05b33f04999584f.tar.bz2
samba-118f3edd27f5adacc1da636ed05b33f04999584f.zip
r1291: rename struct smbsrv_context to smbsrv_connection
because this is the connection state per transport layer (tcp) connection I also moved the substructs directly into smbsrv_connection, because they don't need a struct name and we should allway pass the complete smbsrv_connection struct into functions metze (This used to be commit 60f823f201fcedf5473008e8453a6351e73a92c7)
Diffstat (limited to 'source4/smb_server/request.c')
-rw-r--r--source4/smb_server/request.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source4/smb_server/request.c b/source4/smb_server/request.c
index d845a78c0d..3bfe6a4e73 100644
--- a/source4/smb_server/request.c
+++ b/source4/smb_server/request.c
@@ -45,7 +45,7 @@ void req_destroy(struct smbsrv_request *req)
construct a basic request packet, mostly used to construct async packets
such as change notify and oplock break requests
****************************************************************************/
-struct smbsrv_request *init_smb_request(struct smbsrv_context *smb_ctx)
+struct smbsrv_request *init_smb_request(struct smbsrv_connection *smb_conn)
{
struct smbsrv_request *req;
TALLOC_CTX *mem_ctx;
@@ -54,12 +54,12 @@ struct smbsrv_request *init_smb_request(struct smbsrv_context *smb_ctx)
structure itself is also allocated inside this context, so
we need to allocate it before we construct the request
*/
- mem_ctx = talloc_init("request_context[%d]", smb_ctx->socket.pkt_count);
+ mem_ctx = talloc_init("request_context[%d]", smb_conn->socket.pkt_count);
if (!mem_ctx) {
return NULL;
}
- smb_ctx->socket.pkt_count++;
+ smb_conn->socket.pkt_count++;
req = talloc(mem_ctx, sizeof(*req));
if (!req) {
@@ -69,7 +69,7 @@ struct smbsrv_request *init_smb_request(struct smbsrv_context *smb_ctx)
ZERO_STRUCTP(req);
/* setup the request context */
- req->smb_ctx = smb_ctx;
+ req->smb_conn = smb_conn;
req->mem_ctx = mem_ctx;
return req;
@@ -91,7 +91,7 @@ static void req_setup_chain_reply(struct smbsrv_request *req, uint_t wct, uint_t
req->out.buffer = talloc_realloc(req->mem_ctx, req->out.buffer, req->out.allocated);
if (!req->out.buffer) {
- exit_server(req->smb_ctx, "allocation failed");
+ exit_server(req->smb_conn, "allocation failed");
}
req->out.hdr = req->out.buffer + NBT_HDR_SIZE;
@@ -125,7 +125,7 @@ void req_setup_reply(struct smbsrv_request *req, uint_t wct, uint_t buflen)
req->out.buffer = talloc(req->mem_ctx, req->out.allocated);
if (!req->out.buffer) {
- exit_server(req->smb_ctx, "allocation failed");
+ exit_server(req->smb_conn, "allocation failed");
}
req->out.hdr = req->out.buffer + NBT_HDR_SIZE;
@@ -175,7 +175,7 @@ void req_setup_reply(struct smbsrv_request *req, uint_t wct, uint_t buflen)
int req_max_data(struct smbsrv_request *req)
{
int ret;
- ret = req->smb_ctx->negotiate.max_send;
+ ret = req->smb_conn->negotiate.max_send;
ret -= PTR_DIFF(req->out.data, req->out.hdr);
if (ret < 0) ret = 0;
return ret;
@@ -262,7 +262,7 @@ void req_send_reply_nosign(struct smbsrv_request *req)
_smb_setlen(req->out.buffer, req->out.size - NBT_HDR_SIZE);
}
- if (write_data(req->smb_ctx->socket.fd, req->out.buffer, req->out.size) != req->out.size) {
+ if (write_data(req->smb_conn->socket.fd, req->out.buffer, req->out.size) != req->out.size) {
smb_panic("failed to send reply\n");
}
@@ -306,7 +306,7 @@ void req_reply_dos_error(struct smbsrv_request *req, uint8_t eclass, uint16_t ec
*/
void req_setup_error(struct smbsrv_request *req, NTSTATUS status)
{
- if (!lp_nt_status_support() || !(req->smb_ctx->negotiate.client_caps & CAP_STATUS32)) {
+ if (!lp_nt_status_support() || !(req->smb_conn->negotiate.client_caps & CAP_STATUS32)) {
/* convert to DOS error codes */
uint8_t eclass;
uint32_t ecode;