Check-in [c1a0ba8bf0]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:minor scgi fixes
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c1a0ba8bf0d132e56f96e72cefec5f42ed021b7e
User & Date: aldo 2016-12-11 14:36:04.344
Context
2016-12-11
14:36
minor scgi fixes check-in: a9c2207fd7 user: aldo tags: trunk
14:36
minor scgi fixes check-in: c1a0ba8bf0 user: aldo tags: trunk
14:28
added scgi lib check-in: c02c5fc054 user: aldo tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to scgi.sls.
︙︙
10
11
12
13
14
15
16
17

18
19
20
21
22
23
24
;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.

(library (scgi)
  (export scgi-request-handler handle-scgi-connection run-scgi)

  (import (chezscheme)
	  (socket)
	  (netstring)
	  (only (srfi s1 lists) list-index take drop)
	  (only (posix) fork wait-for-pid wait-flag))

  (define (header-get-token l)







|
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.

(library (scgi)
  (export scgi-request-handler handle-scgi-connection run-scgi
	  scgi-headers->bytevector)
  (import (chezscheme)
	  (socket)
	  (netstring)
	  (only (srfi s1 lists) list-index take drop)
	  (only (posix) fork wait-for-pid wait-flag))

  (define (header-get-token l)
︙︙
109
110
111
112
113
114
115
116
117


118
119
120
121
122
123
124

;SERVER EXAMPLE:
(import (scgi))
(run-scgi "localhost" 8088)
;; it will use the default scgi-request-handler

;CLIENT EXAMPLE:
(import (netstring))
(import (socket))


(define sock (socket 'inet 'stream '() 0))
(connect/inet sock "localhost" 8086)
(define h (scgi-headers->bytevector '(("CONTENT_LENGTH" . "10") 
				      ("SCGI" . "1")
				      ("REQUEST_METHOD" . "GET") 
				      ("REQUEST_URI" . "/chez"))))
(write-netstring sock h)







|
|
>
>







110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127

;SERVER EXAMPLE:
(import (scgi))
(run-scgi "localhost" 8088)
;; it will use the default scgi-request-handler

;CLIENT EXAMPLE:
(import (netstring) 
	(socket)
	(scgi))

(define sock (socket 'inet 'stream '() 0))
(connect/inet sock "localhost" 8086)
(define h (scgi-headers->bytevector '(("CONTENT_LENGTH" . "10") 
				      ("SCGI" . "1")
				      ("REQUEST_METHOD" . "GET") 
				      ("REQUEST_URI" . "/chez"))))
(write-netstring sock h)
︙︙