[gforth] / gforth / fget.fs  

gforth: gforth/fget.fs

Diff for /gforth/fget.fs between version 1.1 and 1.3

version 1.1, Fri Sep 24 17:01:00 2010 UTC version 1.3, Fri Dec 31 18:09:02 2010 UTC
Line 1 
Line 1 
 \ a http get command  \ a http get command
   
 \ Copyright (C) 2000,2002,2003,2006,2007 Free Software Foundation, Inc.  \ Copyright (C) 2000,2002,2003,2006,2007,2010 Free Software Foundation, Inc.
   
 \ This file is part of Gforth.  \ This file is part of Gforth.
   
Line 138 
Line 138 
     Content-Length @ IF      Content-Length @ IF
         Content-Length $@ s>number drop r> read-sized  EXIT  THEN          Content-Length $@ s>number drop r> read-sized  EXIT  THEN
     Transfer-Encoding @ IF      Transfer-Encoding @ IF
         Transfer-Encoding $@ s" chunked" str= 0= IF          Transfer-Encoding $@ s" chunked" str= IF
             r> read-chunked  EXIT  THEN  THEN              r> read-chunked  EXIT  THEN  THEN
     r> read-to-end ;      r> read-to-end ;
   
 : fslurp ( addr u -- addr u )  : fslurp ( addr u -- addr u response )
     '/ $split -1 /string      '/' $split -1 /string
     http-open dup >r get-response throw r> read-data  data-buffer $@ ;      http-open dup >r get-response throw r> read-data  data-buffer $@
       response-string $@ bl $split 2drop s>number drop ;
   
   \ download file


Generate output suitable for use with a patch program
Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help