SYN/ACK delays and 139/445
tridge at samba.org
tridge at samba.org
Wed Oct 26 02:30:40 GMT 2005
Volker,
> Would the attached connect_smb.c be ok?
It looks like it would work, but it means we are duplicating a fair
bit of code in a few places. For example, we still have the old
multi-ports logic in clisocket.c, which this code calls (so we have
code which handles multiple ports, calling other code that handles
multiple ports using a different method, but with just one port).
Perhaps we should go with something like this:
1) use 'struct socket_context' instead of 'struct smbcli_socket' in
this code, thus making it usable for all protocols, allowing us to
have one lump of async socket connect code, instead of more than
one. In line with this, rename the functions to:
struct composite_context *socket_connect_multi_send(const char *address,
int *ports,
struct event_context *event_ctx);
and
NTSTATUS socket_connect_multi_recv(struct composite_context *ctx,
struct socket_context **socket);
2) add thin layers on top of this basic functionality that work with
struct smbcli_socket
3) also add a convenience function:
struct composite_context *socket_connect_send(const char *address,
int port,
struct event_context *event_ctx);
which just turns the single port argument into a array of ports,
then calls the _multi function.
Most of this code would then up in lib/socket/, removing (or
simplifying) a bunch of code from libcli/raw/.
What do you think?
Cheers, Tridge
More information about the samba-technical
mailing list