From: helge Date: Wed, 29 Sep 2004 15:12:17 +0000 (+0000) Subject: minor improvements X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=436ffe86909e060f513abe062ef85dc1ddaa432e;p=sope minor improvements git-svn-id: http://svn.opengroupware.org/SOPE/trunk@201 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-core/NGStreams/ChangeLog b/sope-core/NGStreams/ChangeLog index c4d946b0..cf93eb5e 100644 --- a/sope-core/NGStreams/ChangeLog +++ b/sope-core/NGStreams/ChangeLog @@ -1,3 +1,8 @@ +2004-09-29 Helge Hess + + * NGInternetSocketAddress.m: _fillAddress() does not throw an + exception, just returns it. Improved -description (v4.3.46) + 2004-09-06 Helge Hess * NGByteBuffer.m, NGLocalSocketAddress.m, NGCharBuffer.m: fixed diff --git a/sope-core/NGStreams/NGInternetSocketAddress.m b/sope-core/NGStreams/NGInternetSocketAddress.m index 31e90131..c4a537a6 100644 --- a/sope-core/NGStreams/NGInternetSocketAddress.m +++ b/sope-core/NGStreams/NGInternetSocketAddress.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2003 SKYRIX Software AG + Copyright (C) 2000-2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ #include "common.h" @@ -234,7 +233,7 @@ static inline NSString *_nameOfLocalhost(void) { self->isHostFilled = YES; } -- (void)_fillAddress { +- (NSException *)_fillAddress { /* Fill up the INET address based on the host and port ivars. */ @@ -249,7 +248,7 @@ static inline NSString *_nameOfLocalhost(void) { if (self->isAddressFilled) /* address is already filled .. */ - return; + return nil; #if DEBUG NSAssert(self->isHostFilled, @"either host or address must be filled ..."); @@ -337,13 +336,14 @@ static inline NSString *_nameOfLocalhost(void) { break; } } - [[[NGCouldNotResolveHostNameException alloc] - initWithHostName:[self hostName] reason:reason] raise]; + return [[[NGCouldNotResolveHostNameException alloc] + initWithHostName:[self hostName] reason:reason] autorelease]; } self->isAddressFilled = YES; } } + return nil; } /* constructors */ @@ -525,7 +525,7 @@ static inline NSString *_nameOfLocalhost(void) { return nil; if (!self->isAddressFilled) - [self _fillAddress]; + [[self _fillAddress] raise]; { char *ptr = NULL; @@ -545,7 +545,7 @@ static inline NSString *_nameOfLocalhost(void) { - (int)port { /* how to do ? */ if (!self->isAddressFilled) - [self _fillAddress]; + [[self _fillAddress] raise]; return ntohs(((struct sockaddr_in *)self->address)->sin_port); } @@ -561,7 +561,7 @@ static inline NSString *_nameOfLocalhost(void) { // NGCouldNotResolveHostNameException when a DNS lookup fails if (!self->isAddressFilled) - [self _fillAddress]; + [[self _fillAddress] raise]; return self->address; } @@ -625,18 +625,33 @@ static inline NSString *_nameOfLocalhost(void) { /* description */ - (NSString *)stringValue { - NSString *name = [self hostName]; - if (name == nil) name = @"*"; + NSString *name; + + if ((name = [self hostName]) == nil) + name = @"*"; + return [NSString stringWithFormat:@"%@:%i", name, [self port]]; } - (NSString *)description { - NSString *name = [self hostName]; + NSMutableString *ms; + id tmp; - if (name == nil) name = @"*"; + ms = [NSMutableString stringWithCapacity:128]; + [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])]; + + if ((tmp = [self hostName]) != nil) + [ms appendFormat:@" host=%@", tmp]; + else + [ms appendString:@" *host"]; + + if (!self->isAddressFilled) + [ms appendString:@" not-filled"]; + else + [ms appendFormat:@" port=%d", [self port]]; - return [NSString stringWithFormat:@"", - name, [self port]]; + [ms appendString:@">"]; + return ms; } @end /* NGInternetSocketAddress */ diff --git a/sope-core/NGStreams/Version b/sope-core/NGStreams/Version index 332a1c4c..3e648f95 100644 --- a/sope-core/NGStreams/Version +++ b/sope-core/NGStreams/Version @@ -1,3 +1,3 @@ -# $Id: Version 4 2004-08-20 17:04:31Z helge $ +# version file -SUBMINOR_VERSION:=45 +SUBMINOR_VERSION:=46 diff --git a/sope-mime/ChangeLog b/sope-mime/ChangeLog index 610347ab..32bc949d 100644 --- a/sope-mime/ChangeLog +++ b/sope-mime/ChangeLog @@ -1,3 +1,7 @@ +2004-09-29 Helge Hess + + * NGImap4: minor improvements (v4.3.181) + 2004-09-21 Marcus Mueller * sope-mime.xcode: fixes diff --git a/sope-mime/NGImap4/ChangeLog b/sope-mime/NGImap4/ChangeLog index 1347da23..b65e3a66 100644 --- a/sope-mime/NGImap4/ChangeLog +++ b/sope-mime/NGImap4/ChangeLog @@ -1,3 +1,7 @@ +2004-09-29 Helge Hess + + * NGImap4Client.m: improved -description (v4.3.181) + 2004-09-21 Marcus Mueller * imCommon.h: Fixed duplicate interface declarations by renaming diff --git a/sope-mime/NGImap4/NGImap4Client.m b/sope-mime/NGImap4/NGImap4Client.m index 3c7da2d7..24710326 100644 --- a/sope-mime/NGImap4/NGImap4Client.m +++ b/sope-mime/NGImap4/NGImap4Client.m @@ -1316,10 +1316,19 @@ static inline NSArray *_flags2ImapFlags(NGImap4Client *self, NSArray *_flags) { - (NSString *)description { NSMutableString *ms; + id tmp; ms = [NSMutableString stringWithCapacity:128]; [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])]; - [ms appendFormat:@" socket=%@", [self socket]]; + + if (self->login != nil) + [ms appendFormat:@" login=%@%s", self->login, self->password?"(pwd)":""]; + + if ((tmp = [self socket]) != nil) + [ms appendFormat:@" socket=%@", tmp]; + else if (self->address) + [ms appendFormat:@" address=%@", self->address]; + [ms appendString:@">"]; return ms; } diff --git a/sope-mime/Version b/sope-mime/Version index 33b6652c..d0b11e1a 100644 --- a/sope-mime/Version +++ b/sope-mime/Version @@ -2,6 +2,6 @@ MAJOR_VERSION:=4 MINOR_VERSION:=3 -SUBMINOR_VERSION:=180 +SUBMINOR_VERSION:=181 # v4.2.149 requires libNGStreams v4.2.34