1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
Commit Graph

9 Commits

Author SHA1 Message Date
Andrew Tridgell
7d32679e96 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;
}
(This used to be commit 814881f0e5)
2007-10-10 12:59:39 -05:00
Andrew Tridgell
6f068e207a r2678: from_name and to_name aren't needed in smb_iconv_t
(This used to be commit f3844cc0a5)
2007-10-10 12:59:21 -05:00
Andrew Tridgell
600144050c 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.
(This used to be commit 957b260621)
2007-10-10 12:58:19 -05:00
Stefan Metzmacher
d139dc808a r1912: move popt_common.h
metze
(This used to be commit ecf6be894f)
2007-10-10 12:58:10 -05:00
Stefan Metzmacher
a154ed7291 r1903: hmm a better solution is to include popt.h where it is needed
metze
(This used to be commit 64d61ef4a5)
2007-10-10 12:58:10 -05:00
Stefan Metzmacher
045bdb356f r1902: we need to include popt.h before popt_common.h
metze
(This used to be commit edde7497e9)
2007-10-10 12:58:09 -05:00
Andrew Tridgell
5ddf678e01 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 96bf4da3ed)
2007-10-10 12:57:42 -05:00
Stefan Metzmacher
5779a7da9a 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
(This used to be commit f276378157)
2007-10-10 12:57:36 -05:00
Stefan Metzmacher
2b7cd77ee2 r1065: some header file cleanups
smb.h should end with only smb protocol specific stuff in it

metze
(This used to be commit fda8e59f3d)
2007-10-10 12:56:36 -05:00