Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

openurl denied access to some websites

Status
Not open for further replies.

VBprogrammeur

Programmer
Aug 17, 2001
2
CA
Hi,

Few VB programs on a PC have been accessing our company website to take backups and retrieve online orders since January 2001.

Suddenly all html pages, cgis sent by all domains hosted on the same webserver get truncated after 1250 bytes. Since approximately August 5.

Programs are using the standard Inet1.OpenURL(URL) method.

Same programs access the Yahoo homepage and receive a 40K page, which is normal, and not the then now usual 1250 bytes.

Nothing changed here but length returned is now 1250 regardless of the length of the file sent.

We are using VB 6.0

We have used the NT network, then bypassed it for the Cisco routeur only, then a simple modem connection - plugged into the wall - same result. Only 1250 bytes

Any suggestion where to look for?

URL of our webserver might be given to individuals with interest in helping finding a solution.

Here is the test script we have used to show length of message received and the message itself.

Thanks in advance.
===============================================
Private Sub Command1_Click()

Text1.Text = " "
Text2.Text = "In Progress..."
Dim Data_String1
Dim strinPut As String

strinPut = Text3.Text
Dim URL_String1 As String
URL_String1 = strinPut
Data_String1 = Internet.OpenURL(URL_String1)

Text1.Text = "Length = " + Str(Len(Data_String1))
Text2.Text = Data_String1
End Sub

Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = "End Sub
===============================================
 
module:
Public Const INTERNET_OPEN_TYPE_PRECONFIG = 0
Public Const INTERNET_OPEN_TYPE_DIRECT = 1
Public Const INTERNET_OPEN_TYPE_PROXY = 3
Public lastpo As Long
Public found As Long

Public Const scUserAgent = "VB OpenUrl"
Public Const INTERNET_FLAG_RELOAD = &H80000000

Public Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" _
(ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, _
ByVal sProxyBypass As String, ByVal lFlags As Long) As Long

Public Declare Function InternetOpenUrl Lib "wininet.dll" Alias "InternetOpenUrlA" _
(ByVal hOpen As Long, ByVal sUrl As String, ByVal sHeaders As String, _
ByVal lLength As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long

Public Declare Function InternetReadFile Lib "wininet.dll" _
(ByVal hFile As Long, ByVal sBuffer As String, ByVal lNumBytesToRead As Long, _
lNumberOfBytesRead As Long) As Integer

Public Declare Function InternetCloseHandle Lib "wininet.dll" _
(ByVal hInet As Long) As Integer






form:

Private Function GetHTMLFromURL(sUrl As String) As String ' this sub was for receiving the full/entire
' web page and is redundant, almost. should
' be removed if possible


hOpen = InternetOpen(scUserAgent, INTERNET_OPEN_TYPE_PRECONFIG, vbNullString, vbNullString, 0)
hOpenUrl = InternetOpenUrl(hOpen, sUrl, vbNullString, 0, INTERNET_FLAG_RELOAD, 0)

bDoLoop = True
While bDoLoop
sReadBuffer = vbNullString
bRet = InternetReadFile(hOpenUrl, sReadBuffer, Len(sReadBuffer), lNumberOfBytesRead)
s = s & Left$(sReadBuffer, lNumberOfBytesRead)
dlNumberOfBytesRead = dlNumberOfBytesRead + lNumberOfBytesRead
Form1.Text3 = dlNumberOfBytesRead
DoEvents
If Not CBool(lNumberOfBytesRead) Then bDoLoop = False
Wend

If hOpenUrl <> 0 Then InternetCloseHandle (hOpenUrl)
If hOpen <> 0 Then InternetCloseHandle (hOpen)

GetHTMLFromURL = s

hOpen = 0
hOpenUrl = 0
sBuffer = &quot;&quot;
sReadBuffer = &quot;&quot;


End Function


you can find this on ms web site: it seems to be a sequence packet issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top