1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-19 21:57:57 +03:00

9 Commits

Author SHA1 Message Date
Andrew Tridgell
814881f0e5 r2857: this commit gets rid of smb_ucs2_t, wpstring and fpstring, plus lots of associated functions.
The motivation for this change was to avoid having to convert to/from
ucs2 strings for so many operations. Doing that was slow, used many
static buffers, and was also incorrect as it didn't cope properly with
unicode codepoints above 65536 (which could not be represented
correctly as smb_ucs2_t chars)

The two core functions that allowed this change are next_codepoint()
and push_codepoint(). These functions allow you to correctly walk a
arbitrary multi-byte string a character at a time without converting
the whole string to ucs2.

While doing this cleanup I also fixed several ucs2 string handling
bugs. See the commit for details.

The following code (which counts the number of occuraces of 'c' in a
string) shows how to use the new interface:

size_t count_chars(const char *s, char c)
{
	size_t count = 0;

	while (*s) {
		size_t size;
		codepoint_t c2 = next_codepoint(s, &size);
		if (c2 == c) count++;
		s += size;
	}

	return count;
}
2007-10-10 12:59:39 -05:00
Andrew Tridgell
f3844cc0a5 r2678: from_name and to_name aren't needed in smb_iconv_t 2007-10-10 12:59:21 -05:00
Andrew Tridgell
957b260621 r2039: got rid of the free() ptr in DATA_BLOB
I plan on replacing the concept by adding a generic destructor in all talloc ptrs, so you can do:

  talloc_set_destructor(ptr, my_destructor);

to setup a function that will be called on free.
2007-10-10 12:58:19 -05:00
Stefan Metzmacher
ecf6be894f r1912: move popt_common.h
metze
2007-10-10 12:58:10 -05:00
Stefan Metzmacher
64d61ef4a5 r1903: hmm a better solution is to include popt.h where it is needed
metze
2007-10-10 12:58:10 -05:00
Stefan Metzmacher
edde7497e9 r1902: we need to include popt.h before popt_common.h
metze
2007-10-10 12:58:09 -05:00
Andrew Tridgell
96bf4da3ed 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.
2007-10-10 12:57:42 -05:00
Stefan Metzmacher
f276378157 r1499: combine struct user_struct and struct smbsrv_user
to a struct smbsrv_session that the same as cli_session for the client

we need a gensec_security pointer there
(spnego support will follow)

prefix some related functions with smbsrv_

metze
2007-10-10 12:57:36 -05:00
Stefan Metzmacher
fda8e59f3d r1065: some header file cleanups
smb.h should end with only smb protocol specific stuff in it

metze
2007-10-10 12:56:36 -05:00