From: helge Date: Thu, 21 Jul 2005 08:19:35 +0000 (+0000) Subject: small perf-improvement for matching etags X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcc6ccee4fa4921be35e16d5694f105e567c26ca;p=scalable-opengroupware.org small perf-improvement for matching etags git-svn-id: http://svn.opengroupware.org/SOGo/trunk@860 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/UI/MailerUI/ChangeLog b/SOGo/UI/MailerUI/ChangeLog index 9853adba..f2bc548b 100644 --- a/SOGo/UI/MailerUI/ChangeLog +++ b/SOGo/UI/MailerUI/ChangeLog @@ -1,3 +1,8 @@ +2005-07-21 Helge Hess + + * UIxMailView.m: do not fetch full message info for 304 existance + checks but rather call -doesMailExist (v0.9.162) + 2005-07-20 Helge Hess * removed 'stop' buttons from toolbars (v0.9.161) diff --git a/SOGo/UI/MailerUI/UIxMailView.m b/SOGo/UI/MailerUI/UIxMailView.m index e430593d..4befcc04 100644 --- a/SOGo/UI/MailerUI/UIxMailView.m +++ b/SOGo/UI/MailerUI/UIxMailView.m @@ -162,14 +162,7 @@ static NSString *mailETag = nil; /* actions */ - (id)defaultAction { - if ([self message] == nil) { - // TODO: redirect to proper error - return [NSException exceptionWithHTTPStatus:404 /* Not Found */ - reason:@"did not find specified message!"]; - } - /* check etag to see whether we really must rerender */ - if (mailETag != nil ) { NSString *s; @@ -177,11 +170,24 @@ static NSString *mailETag = nil; if ([s rangeOfString:mailETag].length > 0) { /* not perfectly correct */ /* client already has the proper entity */ // [self logWithFormat:@"MATCH: %@ (tag %@)", s, mailETag]; + + if (![[self clientObject] doesMailExist]) { + return [NSException exceptionWithHTTPStatus:404 /* Not Found */ + reason:@"message got deleted"]; + } + [[[self context] response] setStatus:304 /* Not Modified */]; return [[self context] response]; } } } + + if ([self message] == nil) { + // TODO: redirect to proper error + return [NSException exceptionWithHTTPStatus:404 /* Not Found */ + reason:@"did not find specified message!"]; + } + return self; } diff --git a/SOGo/UI/MailerUI/Version b/SOGo/UI/MailerUI/Version index f9819ac3..380f56ff 100644 --- a/SOGo/UI/MailerUI/Version +++ b/SOGo/UI/MailerUI/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=161 +SUBMINOR_VERSION:=162 # v0.9.140 requires SoObjects/Mailer v0.9.100 # v0.9.134 requires libSOGo v0.9.41