|
@@ -1,24 +1,26 @@
|
|
|
|
|
|
-Strict
|
|
|
+SuperStrict
|
|
|
|
|
|
Module BRL.HTTPStream
|
|
|
|
|
|
-ModuleInfo "Version: 1.02"
|
|
|
+ModuleInfo "Version: 1.03"
|
|
|
ModuleInfo "Author: Mark Sibly"
|
|
|
ModuleInfo "License: zlib/libpng"
|
|
|
ModuleInfo "Copyright: Blitz Research Ltd"
|
|
|
ModuleInfo "Modserver: BRL"
|
|
|
|
|
|
+ModuleInfo "History: 1.03"
|
|
|
+ModuleInfo "History: Module is now SuperStrict"
|
|
|
ModuleInfo "History: 1.02 Release"
|
|
|
|
|
|
Import BRL.SocketStream
|
|
|
|
|
|
Type THTTPStreamFactory Extends TStreamFactory
|
|
|
|
|
|
- Method CreateStream:TStream( url:Object,proto$,path$,readable,writeable )
|
|
|
+ Method CreateStream:TStream( url:Object,proto$,path$,readable:Int,writeable:Int )
|
|
|
If proto="http"
|
|
|
|
|
|
- Local i=path.Find( "/",0 ),server$,file$
|
|
|
+ Local i:Int=path.Find( "/",0 ),server$,file$
|
|
|
If i<>-1
|
|
|
server=path[..i]
|
|
|
file=path[i..]
|
|
@@ -28,7 +30,7 @@ Type THTTPStreamFactory Extends TStreamFactory
|
|
|
EndIf
|
|
|
|
|
|
Local stream:TStream=TSocketStream.CreateClient( server,80 )
|
|
|
- If Not stream Return
|
|
|
+ If Not stream Return Null
|
|
|
|
|
|
stream.WriteLine "GET "+file+" HTTP/1.0"
|
|
|
stream.WriteLine "Host: "+server
|