Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 78de2d8d31450bed95851bf0721c2ac82cfbb612
Author: bpbecker <[email protected]>
Date:   Fri Feb 9 17:53:00 2024 -0500

    v1.17.0 FIFO and Content-Length=0

    Enable FIFO by default.
    Mark request as complete when content-length header is 0.
    Update distribution workspaces
    Update Tatin package definition

commit 254d7ce1fa555a98f79fa6188372d4be5fbd10f3
Author: bpbecker <[email protected]>
Date:   Fri Feb 9 11:34:44 2024 -0500

    FIFO and Content-Length=0
  • Loading branch information
bpbecker committed Feb 9, 2024
1 parent ff8e577 commit a02f514
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
Binary file modified Distribution/Jarvis.dws
Binary file not shown.
Binary file modified Distribution/JarvisService.dws
Binary file not shown.
31 changes: 20 additions & 11 deletions Source/Jarvis.dyalog
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

rVersion
:Access public shared
r'Jarvis' '1.16.3' '2024-01-12'
r'Jarvis' '1.17.0' '2024-02-09'

Documentation
Expand Down Expand Up @@ -71,6 +71,7 @@
:Field Public BufferSize10000 Conga: buffer size
:Field Public DenyFrom Conga: IP addresses to refuse requests from - empty means deny none
:Field Public DOSLimit¯1 Conga: DOSLimit, ¯1 means use default
:Field Public FIFO1 Conga: Use FIFO mode?
:Field Public Port8080 Conga: Default port to listen on
:Field Public RootCertDir'' Conga: Root CA certificate folder
:field Public Priority'NORMAL:!CTYPE-OPENPGP' Conga: Priorities for GnuTLS when negotiation connection
Expand Down Expand Up @@ -161,7 +162,7 @@
{msg}{level}Log msg;ts;fmsg
:Access public overridable
:If Logging>0msg
ts(2⎕SI),'[',(2⎕LC),'] ',fmtTS ⎕TS
ts((ErrorInfoLevel=2)/(2⎕SI),'[',(2⎕LC),'] '),fmtTS ⎕TS
:If 1=fmsgmsg
:OrIf 1=fmsg
fmsgts,' - ',fmsg
Expand Down Expand Up @@ -694,7 +695,7 @@
options''

:If 3.3CongaVersion can we set DecodeBuffers at server creation?
options'Options' 5 DecodeBuffers + WSAutoAccept
options'Options'(5+32×FIFO) WSAutoAccept (1) + DecodeBuffers (4) + EnableFifo (32)
:EndIf

:If 3.4CongaVersion DOSLimit support started with v3.4
Expand All @@ -711,7 +712,7 @@
:If 0=rc1rLDRC.Srv ServerName''Port'http'BufferSize,secureParams,accept,deny,options
ServerName2r
:If 3.3>CongaVersion
{}LDRC.SetProp ServerName'FIFOMode' 0 deprecated in Conga v3.2
{}LDRC.SetProp ServerName'FIFOMode'FIFO deprecated in Conga v3.2
{}LDRC.SetProp ServerName'DecodeBuffers' 15 15 ⍝ decode all buffers
{}LDRC.SetProp ServerName'WSFeatures' 1 auto accept WS requests
:EndIf
Expand Down Expand Up @@ -774,7 +775,7 @@
RemoveConnection conx Conga closes object on an Error event

:Case 'Connect'
AddConnection conx
obj AddConnection conx

:CaseList 'HTTPHeader' 'HTTPTrailer' 'HTTPChunk' 'HTTPBody'
:If (DebugLevel 8)evt'HTTPHeader'
Expand Down Expand Up @@ -831,11 +832,17 @@
(_stop _started _stopped)0 0 1

AddConnection conx
obj AddConnection conx;IP;res
:Hold '_connections'
conx _connections.⎕NS''
_connections.index,conx(⎕AI[3])
(_connectionsconx).IP22LDRC.GetProp obj'PeerAddr'
IP''
:Trap 0 DebugLevel 1
:If 0=resLDRC.GetProp obj'PeerAddr'
IP22res
:EndIf
:EndTrap
(_connectionsconx).IPIP
:EndHold

Expand Down Expand Up @@ -1362,7 +1369,7 @@
makeResponse

make1 args;query;origin;length;param;value;type
make1 args;query;origin;length;param;value;type;noLength;len
args is the result of Conga HTTPHeader event
:Access public
:Implements constructor
Expand Down Expand Up @@ -1403,9 +1410,11 @@
0
:EndTrap

lengthGetHeader'content-length'
Complete('get'Method)0=⊃⊃(//)⎕VFI length we're a GET and there's no content-length or content-length=0
Complete(0length)>/'chunked'GetHeader'transfer-encoding' or no length supplied and we're not chunked
noLength0lengthGetHeader'content-length'
len⊃⊃(//)⎕VFI length
Complete('get'Method)noLength0=len we're a GET and there's no content-length or content-length=0
CompletenoLength>/'chunked'GetHeader'transfer-encoding' or no length supplied and we're not chunked
CompletenoLength<0=len or if content-length=0

makeResponse
Expand Down
2 changes: 1 addition & 1 deletion apl-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
source: "source/Jarvis.dyalog",
tags: "mac-os,windows,linux,http,webservice,json,rest",
userCommandScript: "",
version: "1.16.3+1",
version: "1.16.4",
}

0 comments on commit a02f514

Please sign in to comment.