summaryrefslogtreecommitdiff
path: root/source4/client
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-07-23 06:40:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:57:42 -0500
commit5ddf678e0113f81aa2b5f99134cda4fe8c01afb7 (patch)
tree68e10d04766a1ad8e05f30c4d58e4398343ac7fb /source4/client
parent1ce4a2d5fecae297e5b6f6e8f0d68534d9dc7c92 (diff)
downloadsamba-5ddf678e0113f81aa2b5f99134cda4fe8c01afb7.tar.gz
samba-5ddf678e0113f81aa2b5f99134cda4fe8c01afb7.tar.bz2
samba-5ddf678e0113f81aa2b5f99134cda4fe8c01afb7.zip
r1578: the first stage of the async client rewrite.
Up to now the client code has had an async API, and operated asynchronously at the packet level, but was not truly async in that it assumed that it could always write to the socket and when a partial packet came in that it could block waiting for the rest of the packet. This change makes the SMB client library full async, by adding a separate outgoing packet queue, using non-blocking socket IO and having a input buffer that can fill asynchonously until the full packet has arrived. The main complexity was in dealing with the events structure when using the CIFS proxy backend. In that case the same events structure needs to be used in both the client library and the main smbd server, so that when the client library is waiting for a reply that the main server keeps processing packets. This required some changes in the events library code. Next step is to make the generated rpc client code use these new capabilities. (This used to be commit 96bf4da3edc4d64b0f58ef520269f3b385b8da02)
Diffstat (limited to 'source4/client')
-rw-r--r--source4/client/client.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/source4/client/client.c b/source4/client/client.c
index 0ad3eed889..abc4033f29 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -2677,8 +2677,6 @@ make sure we swallow keepalives during idle time
****************************************************************************/
static void readline_callback(void)
{
- fd_set fds;
- struct timeval timeout;
static time_t last_t;
time_t t;
@@ -2688,28 +2686,7 @@ static void readline_callback(void)
last_t = t;
- again:
- if (cli->transport->socket->fd == -1)
- return;
-
- FD_ZERO(&fds);
- FD_SET(cli->transport->socket->fd, &fds);
-
- timeout.tv_sec = 0;
- timeout.tv_usec = 0;
- sys_select_intr(cli->transport->socket->fd+1,&fds,NULL,NULL,&timeout);
-
- /* We deliberately use cli_swallow_keepalives instead of
- client_receive_smb as we want to receive
- session keepalives and then drop them here.
- */
- if (FD_ISSET(cli->transport->socket->fd, &fds)) {
- if (!cli_request_receive_next(cli->transport)) {
- d_printf("Lost connection to server\n");
- exit(1);
- }
- goto again;
- }
+ cli_transport_process(cli->transport);
if (cli->tree) {
cli_chkpath(cli->tree, "\\");