From 20907893784a51a1df864f8855d4a48bcf4a97b0 Mon Sep 17 00:00:00 2001
From: Slava Pestov <slava@slava-pestovs-macbook-pro.local>
Date: Tue, 20 May 2008 17:40:43 -0500
Subject: [PATCH 1/4] Fix bogus error

---
 extra/symbols/symbols-tests.factor | 7 ++++++-
 extra/symbols/symbols.factor       | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/extra/symbols/symbols-tests.factor b/extra/symbols/symbols-tests.factor
index 0eacbbfd38..1ae4a38cb7 100755
--- a/extra/symbols/symbols-tests.factor
+++ b/extra/symbols/symbols-tests.factor
@@ -1,4 +1,4 @@
-USING: kernel symbols tools.test parser generic words ;
+USING: kernel symbols tools.test parser generic words accessors ;
 IN: symbols.tests
 
 [ ] [ SYMBOLS: a b c ; ] unit-test
@@ -13,3 +13,8 @@ DEFER: blah
 
 [ f ] [ \ blah generic? ] unit-test
 [ t ] [ \ blah symbol? ] unit-test
+
+[ "IN: symbols.tests USE: symbols SINGLETONS: blah blah blah ;" eval ]
+[ error>> error>> def>> \ blah eq? ]
+must-fail-with
+
diff --git a/extra/symbols/symbols.factor b/extra/symbols/symbols.factor
index 50733a620e..20cf16e640 100755
--- a/extra/symbols/symbols.factor
+++ b/extra/symbols/symbols.factor
@@ -10,5 +10,5 @@ IN: symbols
 
 : SINGLETONS:
     ";" parse-tokens
-    [ create-class-in dup save-location define-singleton-class ] each ;
+    [ create-class-in define-singleton-class ] each ;
     parsing

From db314db570e26e370d2e1d0a3bb39d5b9eec220f Mon Sep 17 00:00:00 2001
From: Slava Pestov <slava@slava-pestovs-macbook-pro.local>
Date: Tue, 20 May 2008 18:24:32 -0500
Subject: [PATCH 2/4] Fix chunked encoding to work with yahoo

---
 extra/http/client/client-tests.factor | 4 ++--
 extra/http/client/client.factor       | 8 ++++++--
 extra/http/http.factor                | 3 ++-
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/extra/http/client/client-tests.factor b/extra/http/client/client-tests.factor
index 9ad805b81b..db90f746ac 100755
--- a/extra/http/client/client-tests.factor
+++ b/extra/http/client/client-tests.factor
@@ -17,7 +17,7 @@ tuple-syntax namespaces ;
         path: "/index.html"
         version: "1.1"
         cookies: V{ }
-        header: H{ { "connection" "close" } }
+        header: H{ { "connection" "close" } { "user-agent" "Factor http.client vocabulary" } }
     }
 ] [
     [
@@ -35,7 +35,7 @@ tuple-syntax namespaces ;
         path: "/index.html"
         version: "1.1"
         cookies: V{ }
-        header: H{ { "connection" "close" } }
+        header: H{ { "connection" "close" } { "user-agent" "Factor http.client vocabulary" } }
     }
 ] [
     [
diff --git a/extra/http/client/client.factor b/extra/http/client/client.factor
index cec1bb931a..c455c8c5f1 100755
--- a/extra/http/client/client.factor
+++ b/extra/http/client/client.factor
@@ -4,7 +4,7 @@ USING: assocs http kernel math math.parser namespaces sequences
 io io.sockets io.streams.string io.files io.timeouts strings
 splitting calendar continuations accessors vectors math.order
 io.encodings.8-bit io.encodings.binary io.streams.duplex
-fry debugger inspector ;
+fry debugger inspector ascii ;
 IN: http.client
 
 : max-redirects 10 ;
@@ -37,8 +37,12 @@ SYMBOL: redirects
 
 PRIVATE>
 
+: read-chunk-size ( -- n )
+    read-crlf ";" split1 drop [ blank? ] right-trim
+    hex> [ "Bad chunk size" throw ] unless* ;
+
 : read-chunks ( -- )
-    read-crlf ";" split1 drop hex> dup { f 0 } member?
+    read-chunk-size dup zero?
     [ drop ] [ read % read-crlf "" assert= read-chunks ] if ;
 
 : read-response-body ( response -- response data )
diff --git a/extra/http/http.factor b/extra/http/http.factor
index bc79424552..7587cb0fe9 100755
--- a/extra/http/http.factor
+++ b/extra/http/http.factor
@@ -256,7 +256,8 @@ cookies ;
         H{ } clone >>header
         H{ } clone >>query
         V{ } clone >>cookies
-        "close" "connection" set-header ;
+        "close" "connection" set-header
+        "Factor http.client vocabulary" "user-agent" set-header ;
 
 : query-param ( request key -- value )
     swap query>> at ;

From 332960adab38c7107de253157cd8cad4365dac48 Mon Sep 17 00:00:00 2001
From: Slava Pestov <slava@slava-pestovs-macbook-pro.local>
Date: Tue, 20 May 2008 18:25:21 -0500
Subject: [PATCH 3/4] Doc fix

---
 core/kernel/kernel-docs.factor | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/kernel/kernel-docs.factor b/core/kernel/kernel-docs.factor
index e4100557e1..60151d9f55 100755
--- a/core/kernel/kernel-docs.factor
+++ b/core/kernel/kernel-docs.factor
@@ -630,7 +630,7 @@ HELP: tri*
     "The following two lines are equivalent:"
     { $code
         "[ p ] [ q ] [ r ] tri*"
-        ">r >r q r> q r> r"
+        ">r >r p r> q r> r"
     }
 } ;
 

From 41490d386f7c0ec729118330dbdf8e724beed294 Mon Sep 17 00:00:00 2001
From: Slava Pestov <slava@slava-pestovs-macbook-pro.local>
Date: Tue, 20 May 2008 18:25:29 -0500
Subject: [PATCH 4/4] Fix misleading error message

---
 extra/openssl/openssl.factor | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/extra/openssl/openssl.factor b/extra/openssl/openssl.factor
index a7ba2eab0f..df285d26c2 100755
--- a/extra/openssl/openssl.factor
+++ b/extra/openssl/openssl.factor
@@ -153,13 +153,13 @@ M: openssl-context dispose*
 
 TUPLE: ssl-handle file handle connected disposed ;
 
-ERROR: no-ssl-context ;
+ERROR: no-secure-context ;
 
-M: no-ssl-context summary
-    drop "SSL operations must be wrapped in calls to with-ssl-context" ;
+M: no-secure-context summary
+    drop "Secure socket operations must be wrapped in calls to with-secure-context" ;
 
 : current-ssl-context ( -- ctx )
-    secure-context get [ no-ssl-context ] unless* ;
+    secure-context get [ no-secure-context ] unless* ;
 
 : <ssl-handle> ( fd -- ssl )
     current-ssl-context handle>> SSL_new dup ssl-error