[Seaside] a <sameAs:> DNU from : ZnMessage>>isConnectionClose

lb liangbing64 at 126.com
Fri Apr 27 12:06:03 UTC 2018


Hi Sven
It came again.

Array(Object)>>doesNotUnderstand: #sameAs:
ZnRequest(ZnMessage)>>isConnectionClose
ZnRequest>>wantsConnectionClose
ZnResponse>>setConnectionCloseFor:
ZnManagingMultiThreadedServer(ZnMultiThreadedServer)>>augmentResponse:forRequest:
ZnManagingMultiThreadedServer(ZnMultiThreadedServer)>>executeOneRequestResponseOn:
[ [ self executeOneRequestResponseOn: stream ] whileFalse ] in ZnManagingMultiThreadedServer(ZnMultiThreadedServer)>>executeRequestResponseLoopOn:
[ activeProcess psValueAt: index put: anObject.
aBlock value ] in ZnCurrentServer(DynamicVariable)>>value:during:
BlockClosure>>ensure:
ZnCurrentServer(DynamicVariable)>>value:during:
ZnCurrentServer class(DynamicVariable class)>>value:during:
ZnManagingMultiThreadedServer(ZnMultiThreadedServer)>>executeRequestResponseLoopOn:
[ self executeRequestResponseLoopOn: stream ] in [ [ self executeRequestResponseLoopOn: stream ]
 ensure: [ self logConnectionClosed: stream.
  self closeSocketStream: stream ] ] in [ [ [ self executeRequestResponseLoopOn: stream ]
 ensure: [ self logConnectionClosed: stream.
  self closeSocketStream: stream ] ]
 ifCurtailed: [ socket destroy ] ] in ZnManagingMultiThreadedServer(ZnMultiThreadedServer)>>serveConnectionsOn:
BlockClosure>>ensure:
[ [ self executeRequestResponseLoopOn: stream ]
 ensure: [ self logConnectionClosed: stream.
  self closeSocketStream: stream ] ] in [ [ [ self executeRequestResponseLoopOn: stream ]
 ensure: [ self logConnectionClosed: stream.
  self closeSocketStream: stream ] ]
 ifCurtailed: [ socket destroy ] ] in ZnManagingMultiThreadedServer(ZnMultiThreadedServer)>>serveConnectionsOn:
BlockClosure>>ifCurtailed:
[ [ [ self executeRequestResponseLoopOn: stream ]
 ensure: [ self logConnectionClosed: stream.
  self closeSocketStream: stream ] ]
 ifCurtailed: [ socket destroy ] ] in ZnManagingMultiThreadedServer(ZnMultiThreadedServer)>>serveConnectionsOn:
[ self value.
Processor terminateActive ] in BlockClosure>>newProcess




At 2018-04-12 21:47:24, "lb" <liangbing64 at 126.com> wrote:

Hi, Sven,
Thank you very much,
But I am not familiar with HTTP. I recover to original code now.
when that occurs next time, I will copy the error stack here.


Best regards


Liang





At 2018-04-12 20:21:07, "Sven Van Caekenberghe" <sven at stfx.eu> wrote:
>Hi Liang,
>
>Headers in HTTP (as represented/implemented by the ZnHeaders object in Pharo) can be multi-valued. That is, a certain header name (key) can occur more than once. That creates a multi-valued situation. For example, there can be multiple cookies being set. But almost always, there is only one header with a unique name.
>
>What you see must be the result of the 'Connection:close' header line being present twice. I would like to understand how that can happen. Do you have any idea ?
>
>I am also not sure (I should check) what the spec says.
>
>What is special here is that although the header line occurs twice, it has the same/identical value.
>
>In any case, it is the first time I hear about this situation.
>
>Sven 
>
>> On 12 Apr 2018, at 11:30, lb <liangbing64 at 126.com> wrote:
>> 
>> Hi,
>> my website always receives a sameAs: DNU from :
>> ZnMessage>>isConnectionClose
>>  | value |
>>  value := self headers at: 'Connection' ifAbsent: [ ^ false ].
>>  ^ value sameAs: 'close'
>> 
>> value is an Array like #('close' 'close').
>> 
>> I fix like this to avoid receiving DNU message.
>> isConnectionClose
>>  | value |
>>  value := self headers at: 'Connection' ifAbsent: [ ^ false ].
>>  value isArray ifTrue: [^ (value at: 1) sameAs: 'close'].
>>  value isString ifTrue: [^ value sameAs: 'close'].
>>  ^false
>> I can not confirm that fix is correct.
>> Liang
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>_______________________________________________
>seaside mailing list
>seaside at lists.squeakfoundation.org
>http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20180427/c043be69/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PharoScreenshot.png
Type: image/png
Size: 177037 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20180427/c043be69/attachment-0001.png>


More information about the seaside mailing list