ObjXMPP  Check-in [d745afc94c]

Overview
Comment:Do Nodeprep on username and add Makefile
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d745afc94ce325b33b3b4e9eb7ed7e5cc17ac1377e84afa45ae691b4a3f6a832
User & Date: florob@babelmonkeys.de on 2011-02-10 23:59:31
Other Links: manifest | tags
Context
2011-02-11
01:06
Add a basic folder structure check-in: 2e7a482ea5 user: florob@babelmonkeys.de tags: trunk
2011-02-10
23:59
Do Nodeprep on username and add Makefile check-in: d745afc94c user: florob@babelmonkeys.de tags: trunk
22:46
Add sendStanza to XMPPConnection check-in: 6f83a74d30 user: florob@babelmonkeys.de tags: trunk
Changes

Added Makefile version [7c3e50b2d0].

Modified XMPPConnection.m from [9b0fcf1270] to [cdbcbf0e8f].



1
2
3
4
5
6
7
1
2
3
4
5
6
7
8
9
+
+







#include <stringprep.h>
#include <assert.h>
#import "XMPPConnection.h"
#import "XMPPStanza.h"

#define NS_BIND @"urn:ietf:params:xml:ns:xmpp-bind"
#define NS_CLIENT @"jabber:client"
#define NS_SASL @"urn:ietf:params:xml:ns:xmpp-sasl"
#define NS_STREAM @"http://etherx.jabber.org/streams"
38
39
40
41
42
43
44





















45
46
47
48
49
50
51
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







{
	[sock release];
	[parser release];
	[elementBuilder release];

	[super dealloc];
}

- (void)setUsername: (OFString*)username_
{
	OFString *old = username;
	char *node;

	Stringprep_rc rc;
	if ((rc = stringprep_profile([username_ cString], &node, "Nodeprep", 0))
			!= STRINGPREP_OK) {
		of_log(@"Nodeprep failed: %s", stringprep_strerror(rc));
		assert(0);
	}

	@try {
		username = [[OFString alloc] initWithCString: node];
	} @finally {
		free(node);
	}

	[old release];
}

- (void)_startStream
{
	[sock writeFormat: @"<?xml version='1.0'?>\n"
			   @"<stream:stream to='%@' xmlns='" NS_CLIENT @"' "
			   @"xmlns:stream='" NS_STREAM @"' "
			   @"version='1.0'>", server];