Author: thebeing
Date: Wed Jan 20 11:53:26 2016
New Revision: 39295
URL: http://svn.gna.org/viewcvs/gnustep?rev=39295&view=rev
Log:
Fix the x-count-* headers. The WSHType was never assigned to the instance
variable, so -value would always return nil.
Also re-arrange things to not depend on the presence of the GSMimeHeader ivars,
ensuring compatibility with the (pure) non-fragile ABI.
Modified:
libs/webserver/trunk/ChangeLog
libs/webserver/trunk/WebServerHeader.m
Modified: libs/webserver/trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/libs/webserver/trunk/ChangeLog?rev=39295&r1=39294&r2=39295&view=diff
==============================================================================
--- libs/webserver/trunk/ChangeLog (original)
+++ libs/webserver/trunk/ChangeLog Wed Jan 20 11:53:26 2016
@@ -1,3 +1,11 @@
+2016-01-20 Niels Grewe <[email protected]>
+
+ * WebServerHeader.m: Fix the x-count-* headers. The WSHType
+ was never assigned to the instance variable, so -value
+ would always return nil. Also re-arrange things to not
+ depend on the presence of the GSMimeHeader ivars, ensuring
+ compatibility with the (pure) non-fragile ABI.
+
2016-01-15 Niels Grewe <[email protected]>
* WebServer.h: Ensure that the header can be used from ARC
Modified: libs/webserver/trunk/WebServerHeader.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/webserver/trunk/WebServerHeader.m?rev=39295&r1=39294&r2=39295&view=diff
==============================================================================
--- libs/webserver/trunk/WebServerHeader.m (original)
+++ libs/webserver/trunk/WebServerHeader.m Wed Jan 20 11:53:26 2016
@@ -61,31 +61,14 @@
}
if (nil != (self = [super initWithName: @"" value: @"" parameters: nil]))
{
- if (nil != name)
- {
- [name release];
- name = nil;
- }
- if (nil != value)
- {
- [value release];
- value = nil;
- }
wshObject = [o retain];
+ wshType = t;
switch (t)
{
case WSHCountRequests:
- name = @"x-count-requests";
+ case WSHCountConnections:
+ case WSHCountConnectedHosts:
break;
-
- case WSHCountConnections:
- name = @"x-count-connections";
- break;
-
- case WSHCountConnectedHosts:
- name = @"x-count-connected-hosts";
- break;
-
default:
[self release];
[NSException raise: NSInvalidArgumentException
@@ -96,14 +79,25 @@
return self;
}
-- (NSString*) name
+- (NSString*)name
{
- return name;
+ switch (wshType)
+ {
+ case WSHCountRequests:
+ return @"x-count-requests";
+ case WSHCountConnections:
+ return @"x-count-connections";
+ case WSHCountConnectedHosts:
+ return @"x-count-connected-hosts";
+ default:
+ return nil;
+ }
+ return nil;
}
- (NSString*) namePreservingCase: (BOOL)preserve
{
- return name;
+ return [self name];
}
- (id) objectForKey: (NSString*)k
@@ -170,7 +164,7 @@
- (NSString*) text
{
- return [NSString stringWithFormat: @"%@: %@\r\n", name, [self value]];
+ return [NSString stringWithFormat: @"%@: %@\r\n", [self name], [self value]];
}
- (NSString*) value
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs