i found nearly all errors again in you lib:
1.WRONG:
Base64Encoder(conc$,Len(conc$),OutputBuffer,OutputBuffer*2)
Better:
Base64Encoder(conc$,Len(conc$),OutputBuffer,Len(conc$)*2)
2.And a proxy doesn't need always a password.
3.When a proxy is used, you *MUST* give the complete url in the uri
"GET
http://gpihome.de/crillion/english.txt http/1.0"
4. Location in the "request"-header is unused. When you get a "moved" (3xx)-message you must set the "location"-part as new URL.
5. Why you ask first the size "HEAD" and the with "GET"?
With "Get" you get the full header.
The end of a header is definied with chr(13)+chr(10)+chr(13)+chr(10) and it is easy too detect. And when you use a proxy, your connection is disconnected after the head.
6. "Splitted" headers aren't supported. What is, when a header is too long for one "ReceiveNetworkData(internetID,@Content$,14500)" (i mean, when the server doN't send all at one time, because of a bad connection)?
7. ?!?
Code: Select all
Procedure HTTP_Set_Authorization(ConnectionID.l, Username.s,Password.s);Set Authentication Data
EndProcedure
8. CreateThread(@int_Action(),Str(ConnectionID)+"|"+Str(#HTTP_Action_Get2File))
Bad idea, when you use threads and strings.
9. Warning:
Procedure HTTP_Stop();Stops HTTP library
ClearList(http_data())
EndProcedure
You should free memory and break all created threads.
10. Wrong errorhandling:
the errorcode is in the first line of the Content. With you code it is possble, that a "Content-Length: 1404" is detected as error.