]> gitweb.factorcode.org Git - factor.git/commitdiff
gopher: set 1 minute timeout by default.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 27 Dec 2014 03:20:22 +0000 (19:20 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 27 Dec 2014 03:20:22 +0000 (19:20 -0800)
extra/gopher/gopher.factor

index 8bb1c51dfb1c873592bbb2406053d864e056294e..32d81cf3786c23fc20f94091b1d79a0a1aa9ba7a 100644 (file)
@@ -1,12 +1,13 @@
 ! Copyright (C) 2014 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
 
-USING: accessors byte-arrays colors.constants combinators
-formatting fry images images.loader images.loader.private
-images.viewer io io.encodings.binary io.encodings.string
-io.encodings.utf8 io.sockets io.styles kernel make math
-math.parser namespaces present prettyprint sequences splitting
-summary urls urls.encoding vocabs ;
+USING: accessors byte-arrays calendar colors.constants
+combinators formatting fry images images.loader
+images.loader.private images.viewer io io.encodings.binary
+io.encodings.string io.encodings.utf8 io.sockets io.styles
+io.timeouts kernel make math math.parser namespaces present
+prettyprint sequences splitting summary urls urls.encoding
+vocabs ;
 
 IN: gopher
 
@@ -57,7 +58,10 @@ ERROR: not-a-gopher-url url ;
         [ port>> 70 or <inet> binary ]
         [ path>> rest [ "1/" ] when-empty ]
         [ query>> [ assoc>query url-decode "?" glue ] when* ]
-    } cleave '[ _ gopher-get ] with-client ;
+    } cleave '[
+        1 minutes input-stream get set-timeout
+        _ gopher-get
+    ] with-client ;
 
 <PRIVATE