From: Daniel R. <dtr...@us...> - 2004-03-19 02:01:23
|
Update of /cvsroot/bkm/bkm/chklinks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32006/chklinks Modified Files: clsHTTP.cls Log Message: Don't try to get the title of a file that won't have a title Speed up title-getting by restricting to first 5K of the document Index: clsHTTP.cls =================================================================== RCS file: /cvsroot/bkm/bkm/chklinks/clsHTTP.cls,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** clsHTTP.cls 12 Jan 2004 03:44:21 -0000 1.9 --- clsHTTP.cls 19 Mar 2004 01:51:41 -0000 1.10 *************** *** 42,45 **** --- 42,46 ---- Public intHTTPResponse As Integer Private blnHeaderOnly As Boolean + Private lngMaxBytes As Long Public strHost As String Public strFile As String *************** *** 75,79 **** End Property ! Public Sub Download(ByVal strMURL As String) ' Download a site Dim strConnectHost As String --- 76,80 ---- End Property ! Public Sub Download(ByVal strMURL As String, Optional lngMaxKBytes As Long = -1) ' Download a site Dim strConnectHost As String *************** *** 94,97 **** --- 95,101 ---- cTimer.Enabled = True + ' Don't download more than we've been asked to; never download > 1 GB + If lngMaxKBytes > 0 Then lngMaxBytes = lngMaxKBytes * 1024 Else lngMaxBytes = 1024 ^ 3 + objWinsock.Connect strConnectHost, lngConnectPort End Sub *************** *** 309,313 **** strResponse = strResponse & strData ! If blnFinishAfterFirstData Then objWinsock.Disconnect End If --- 313,317 ---- strResponse = strResponse & strData ! If blnFinishAfterFirstData Or (Len(strResponse) > lngMaxBytes) Then objWinsock.Disconnect End If |