diff --git a/basis/http/http.factor b/basis/http/http.factor index 0cc228c73b..cfc205dbb5 100755 --- a/basis/http/http.factor +++ b/basis/http/http.factor @@ -3,15 +3,13 @@ USING: accessors kernel combinators math namespaces make assocs sequences splitting sorting sets debugger strings vectors hashtables quotations arrays byte-arrays -math.parser calendar calendar.format present +math.parser calendar calendar.format present urls logging io io.encodings io.encodings.iana io.encodings.binary io.encodings.8-bit unicode.case unicode.categories qualified -urls - http.parsers ; EXCLUDE: fry => , ; @@ -98,6 +96,8 @@ TUPLE: cookie name value version comment path domain expires max-age http-only s drop ] { } make ; +\ parse-cookie DEBUG add-input-logging + : check-cookie-string ( string -- string' ) dup "=;'\"\r\n" intersect empty? [ "Bad cookie name or value" throw ] unless ; diff --git a/basis/http/parsers/parsers.factor b/basis/http/parsers/parsers.factor index 8e8e7358d1..ce8257dec5 100644 --- a/basis/http/parsers/parsers.factor +++ b/basis/http/parsers/parsers.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: combinators.short-circuit math math.order math.parser kernel sequences sequences.deep peg peg.parsers assocs arrays -hashtables strings unicode.case namespaces make ascii ; +hashtables strings unicode.case namespaces make ascii logging ; IN: http.parsers : except ( quot -- parser ) @@ -61,6 +61,8 @@ PEG: parse-request-line ( string -- triple ) 'space' , ] seq* just ; +\ parse-request-line DEBUG add-input-logging + : 'text' ( -- parser ) [ ctl? ] except ; diff --git a/basis/io/servers/connection/connection.factor b/basis/io/servers/connection/connection.factor index 0bea30faa3..bde4e518ac 100755 --- a/basis/io/servers/connection/connection.factor +++ b/basis/io/servers/connection/connection.factor @@ -78,6 +78,8 @@ M: threaded-server handle-client* handler>> call ; [ timeout>> timeouts ] [ handle-client* ] bi ] with-stream ; +\ handle-client ERROR add-error-logging + : thread-name ( server-name addrspec -- string ) unparse-short " connection from " swap 3append ; diff --git a/basis/io/unix/sockets/secure/secure.factor b/basis/io/unix/sockets/secure/secure.factor index a8adedf25a..649c68673f 100755 --- a/basis/io/unix/sockets/secure/secure.factor +++ b/basis/io/unix/sockets/secure/secure.factor @@ -27,8 +27,10 @@ M: ssl-handle handle-fd file>> handle-fd ; { { SSL_ERROR_NONE [ 2drop f ] } { SSL_ERROR_WANT_READ [ 2drop +input+ ] } + { SSL_ERROR_WANT_ACCEPT [ 2drop +input+ ] } { SSL_ERROR_WANT_WRITE [ 2drop +output+ ] } { SSL_ERROR_SYSCALL [ syscall-error ] } + { SSL_ERROR_ZERO_RETURN [ (ssl-error) ] } { SSL_ERROR_SSL [ (ssl-error) ] } } case ;