svn commit: samba r2326 - in branches/SAMBA_4_0/source: ntvfs/cifs
rpc_server smb_server smbd
metze at samba.org
metze at samba.org
Mon Sep 13 13:13:21 GMT 2004
Author: metze
Date: 2004-09-13 13:13:21 +0000 (Mon, 13 Sep 2004)
New Revision: 2326
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=2326&nolog=1
Log:
remove definition and usage of struct socket_context
metze
Modified:
branches/SAMBA_4_0/source/ntvfs/cifs/vfs_cifs.c
branches/SAMBA_4_0/source/rpc_server/dcerpc_tcp.c
branches/SAMBA_4_0/source/smb_server/request.c
branches/SAMBA_4_0/source/smb_server/service.c
branches/SAMBA_4_0/source/smb_server/smb_server.c
branches/SAMBA_4_0/source/smbd/service.c
branches/SAMBA_4_0/source/smbd/service.h
Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/cifs/vfs_cifs.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/cifs/vfs_cifs.c 2004-09-13 12:44:36 UTC (rev 2325)
+++ branches/SAMBA_4_0/source/ntvfs/cifs/vfs_cifs.c 2004-09-13 13:13:21 UTC (rev 2326)
@@ -51,7 +51,7 @@
static void idle_func(struct smbcli_transport *transport, void *p_private)
{
struct cvfs_private *private = p_private;
- if (socket_pending(private->tcon->smb_conn->connection->socket->fde->fd)) {
+ if (socket_pending(private->tcon->smb_conn->connection->event.fde->fd)) {
smbd_process_async(private->tcon->smb_conn);
}
}
Modified: branches/SAMBA_4_0/source/rpc_server/dcerpc_tcp.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/dcerpc_tcp.c 2004-09-13 12:44:36 UTC (rev 2325)
+++ branches/SAMBA_4_0/source/rpc_server/dcerpc_tcp.c 2004-09-13 13:13:21 UTC (rev 2326)
@@ -139,7 +139,7 @@
* but the smb server can't handle it yet
* --metze
*/
- set_blocking(conn->socket->fde->fd, False);
+ set_blocking(conn->event.fde->fd, False);
return;
}
@@ -158,7 +158,7 @@
return;
}
- ret = read(conn->socket->fde->fd, blob.data, blob.length);
+ ret = read(conn->event.fde->fd, blob.data, blob.length);
if (ret == 0 || (ret == -1 && errno != EINTR)) {
data_blob_free(&blob);
dcesrv_terminate_connection(dce_conn, "eof on socket");
@@ -176,7 +176,7 @@
data_blob_free(&blob);
if (dce_conn->call_list && dce_conn->call_list->replies) {
- conn->socket->fde->flags |= EVENT_FD_WRITE;
+ conn->event.fde->flags |= EVENT_FD_WRITE;
}
return;
@@ -189,13 +189,13 @@
DEBUG(10,("dcesrv_tcp_send\n"));
- status = dcesrv_output(dce_conn, conn->socket->fde, dcerpc_write_fn);
+ status = dcesrv_output(dce_conn, conn->event.fde, dcerpc_write_fn);
if (NT_STATUS_IS_ERR(status)) {
/* TODO: destroy fd_event? */
}
if (!dce_conn->call_list || !dce_conn->call_list->replies) {
- conn->socket->fde->flags &= ~EVENT_FD_WRITE;
+ conn->event.fde->flags &= ~EVENT_FD_WRITE;
}
return;
Modified: branches/SAMBA_4_0/source/smb_server/request.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/request.c 2004-09-13 12:44:36 UTC (rev 2325)
+++ branches/SAMBA_4_0/source/smb_server/request.c 2004-09-13 13:13:21 UTC (rev 2326)
@@ -49,7 +49,7 @@
{
struct smbsrv_request *req;
- smb_conn->connection->socket->pkt_count++;
+ smb_conn->socket.pkt_count++;
req = talloc_p(smb_conn, struct smbsrv_request);
if (!req) {
@@ -251,7 +251,7 @@
_smb_setlen(req->out.buffer, req->out.size - NBT_HDR_SIZE);
}
- if (write_data(req->smb_conn->connection->socket->fde->fd, req->out.buffer, req->out.size) != req->out.size) {
+ if (write_data(req->smb_conn->connection->event.fde->fd, req->out.buffer, req->out.size) != req->out.size) {
smbsrv_terminate_connection(req->smb_conn, "failed to send reply\n");
}
Modified: branches/SAMBA_4_0/source/smb_server/service.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/service.c 2004-09-13 12:44:36 UTC (rev 2325)
+++ branches/SAMBA_4_0/source/smb_server/service.c 2004-09-13 13:13:21 UTC (rev 2326)
@@ -249,7 +249,8 @@
void close_cnum(struct smbsrv_tcon *tcon)
{
DEBUG(3,("%s closed connection to service %s\n",
- tcon->smb_conn->connection->socket->client_addr, lp_servicename(SNUM(tcon))));
+ get_socket_addr(tcon, tcon->smb_conn->connection->event.fde->fd),
+ lp_servicename(SNUM(tcon))));
/* tell the ntvfs backend that we are disconnecting */
tcon->ntvfs_ops->disconnect(tcon);
Modified: branches/SAMBA_4_0/source/smb_server/smb_server.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/smb_server.c 2004-09-13 12:44:36 UTC (rev 2325)
+++ branches/SAMBA_4_0/source/smb_server/smb_server.c 2004-09-13 13:13:21 UTC (rev 2326)
@@ -64,7 +64,7 @@
char header[4];
struct smbsrv_request *req;
- len = read_data(smb_conn->connection->socket->fde->fd, header, 4);
+ len = read_data(smb_conn->connection->event.fde->fd, header, 4);
if (len != 4) {
return NULL;
}
@@ -82,7 +82,7 @@
/* fill in the already received header */
memcpy(req->in.buffer, header, 4);
- len2 = read_data(smb_conn->connection->socket->fde->fd, req->in.buffer + NBT_HDR_SIZE, len);
+ len2 = read_data(smb_conn->connection->event.fde->fd, req->in.buffer + NBT_HDR_SIZE, len);
if (len2 != len) {
return NULL;
}
@@ -831,7 +831,7 @@
/* set an initial client name based on its IP address. This will be replaced with
the netbios name later if it gives us one */
- socket_addr = get_socket_addr(smb_conn, conn->socket->fde->fd);
+ socket_addr = get_socket_addr(smb_conn, conn->event.fde->fd);
sub_set_remote_machine(socket_addr);
/* now initialise a few default values associated with this smb socket */
Modified: branches/SAMBA_4_0/source/smbd/service.c
===================================================================
--- branches/SAMBA_4_0/source/smbd/service.c 2004-09-13 12:44:36 UTC (rev 2325)
+++ branches/SAMBA_4_0/source/smbd/service.c 2004-09-13 13:13:21 UTC (rev 2326)
@@ -210,17 +210,7 @@
srv_conn->service = server_socket->service;
/* TODO: we need a generic socket subsystem */
- srv_conn->socket = talloc_p(srv_conn->mem_ctx, struct socket_context);
- if (!srv_conn->socket) {
- DEBUG(0,("talloc_p(srv_conn->mem_ctx, struct socket_context) failed\n"));
- talloc_destroy(mem_ctx);
- return NULL;
- }
- srv_conn->socket->private_data = NULL;
- srv_conn->socket->ops = NULL;
- srv_conn->socket->client_addr = NULL;
- srv_conn->socket->pkt_count = 0;
- srv_conn->socket->fde = srv_conn->event.fde;
+ srv_conn->socket = NULL;
/* create a smb server context and add it to out event
handling */
@@ -230,8 +220,6 @@
srv_conn->event.fde = event_add_fd(ev,&fde);
srv_conn->event.idle = event_add_timed(ev,&idle);
- srv_conn->socket->fde = srv_conn->event.fde;
-
return srv_conn;
}
Modified: branches/SAMBA_4_0/source/smbd/service.h
===================================================================
--- branches/SAMBA_4_0/source/smbd/service.h 2004-09-13 12:44:36 UTC (rev 2325)
+++ branches/SAMBA_4_0/source/smbd/service.h 2004-09-13 13:13:21 UTC (rev 2326)
@@ -63,18 +63,8 @@
void (*service_exit)(struct server_service *srv_ctx, const char *reason);
};
-struct socket_ops {
- int dummy;
-};
+struct socket_context;
-struct socket_context {
- void *private_data;
- struct socket_ops *ops;
- const char *client_addr;
- uint_t pkt_count;
- struct fd_event *fde;
-};
-
struct server_socket {
struct server_socket *next,*prev;
TALLOC_CTX *mem_ctx;
More information about the samba-cvs
mailing list