David T. Lewis uploaded a new version of WebClient-Core to project The Trunk:
http://source.squeak.org/trunk/WebClient-Core-dtl.127.mcz==================== Summary ====================
Name: WebClient-Core-dtl.127
Author: dtl
Time: 2 December 2020, 9:21:11.256021 pm
UUID: b29c5835-46cf-4f51-b822-b3494063f3f7
Ancestors: WebClient-Core-mt.126
Eliminate the only known use of DateAndTime class>>totalSeconds, use the proper method in class Time instead.
=============== Diff against WebClient-Core-mt.126 ===============
Item was changed:
----- Method: WebUtils class>>logEntryFor:response: (in category 'misc') -----
logEntryFor: request response: response
"Create a log entry in common log format from the given request / response"
| entry logdate logsize |
"CLF prints date as [day/month/year:hour:min:sec zone]"
logdate := String streamContents:[:s| | date |
+ date := DateAndTime fromSeconds: Time totalSeconds.
- date := DateAndTime fromSeconds: DateAndTime totalSeconds.
s nextPut: $[.
date asDate printOn: s format: #( 1 2 3 $/ 2 1 2).
s nextPut: $:.
date asTime print24: true on: s.
s nextPutAll:(' ',
(date offset hours >= 0 ifTrue:['+'] ifFalse:['-']),
(date offset hours abs asString padded: #left to: 2 with: $0),
(date offset minutes abs asString padded: #left to: 2 with: $0)
).
s nextPut: $].
].
"CLF prints zero length as - "
logsize := response contentLength ifNil:[0].
logsize = 0 ifTrue:[logsize := '-'].
entry := String streamContents:[:s|
s
nextPutAll: (request remoteHost ifNil:[
"Substitute with the host header"
(request headerAt: 'host') copyUpTo: $:
]);
nextPutAll: ' -'; "RFC 1413 identity of client"
nextPutAll: ' -'; "TODO: userid of authenticated user"
nextPutAll: ' ', logdate;
nextPutAll: ' "', request requestLine, '"';
nextPutAll: ' ', response code;
nextPutAll: ' ', logsize.
].
^entry
!