bugMIT/GNU Scheme - Bugs: bug #62580, read-http-request procedure is...

 
 

bug #62580: read-http-request procedure is broken

Submitter:  - <_314975>
Submitted:  Sat 04 Jun 2022 05:53:32 AM UTC
   
 
Category:  runtime Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect behavior
Status:  Fixed Privacy:  Public
Assigned to:  cph Originator Name: 
Open/Closed:  Closed
Keywords: 
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 06 Sep 2022 02:08:14 AM UTC, comment #2: 

This is unrelated to bug #62582. It is a problem with URI parsing that will require some careful debugging.

Chris Hanson <cph>
Group administrator
Sat 04 Jun 2022 06:55:01 AM UTC, comment #1: 

This bug is probably caused by bug #62582 but I am not sure, because HTTP functionality is badly broken in MIT Scheme 11.2.

- <_314975>
Sat 04 Jun 2022 05:53:32 AM UTC, original submission:  

(let* ((socket (open-tcp-server-socket 8000))
       (port (tcp-server-connection-accept socket #t #f))
       (request (read-http-request port)))
  (display request))

When I run the code above and access localhost:8000 using a web browser, the `read-http-request` procedure will fail with:

;The object #[textual-i/o-port 12 for channel: #[channel 13]], passed as an argument to #[compiled-procedure 14 ("binary-port" #x2) #x1c #x1a7a6f4], is not the correct type.

So, I changed `tcp-server-connection-accept` to `tcp-server-binary-connection-accept`:

(let* ((socket (open-tcp-server-socket 8000))
       (port (tcp-server-binary-connection-accept socket #t #f))
       (request (read-http-request port)))
  (display request))

However, this will also fail when a client connects to localhost:8000:

;The object 3, passed as the second argument to vector-ref, is not in the correct range.


MIT Scheme version: 11.2

- <_314975>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by cph (Posted a comment)
  • -email is unavailable- added by _314975 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-09-10 cph StatusNone Fixed
        Open/ClosedOpen Closed
    2022-09-06 cph Assigned toNone cph

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code