Переглянути джерело

Fixed Request Body reading

pull/4/head
Ethan Ferguson 3 місяці тому
джерело
коміт
8a0a05434e
Не вдалося знайти GPG ключ що відповідає даному підпису Ідентифікатор GPG ключа: 876F56AB5F896F90
1 змінених файлів з 8 додано та 2 видалено
  1. +8
    -2
      1991.fs

+ 8
- 2
1991.fs Переглянути файл

@@ -347,11 +347,17 @@ s" image/x-icon" filetype: ico
0
then ;

: substring-to-end ( index c-addr u -- c-addr u )
rot dup rot swap - rot rot + swap ;

: read-request-body ( socket u -- )
\ Takes the socket and the length of the
\ body (Content-Length).
here swap aligned read-socket
set-request-body ;
2over swap drop swap -
2over substring-to-end
set-request-body
drop ;

: read-request ( socket -- addr u )
\ Returns the request header
\ but also collects the request body.


Завантаження…
Відмінити
Зберегти