Thanks for the reply, I'm working on a Delphi application but if that
has something to do with the version of WinInet, we all have IE6 on our
machines now.
I can't post a lot of code, I think this includes most of what might be
causing the problem, do you see anything odd here?
if (opReqSession <> nil) then
InternetCloseHandle(opReqSession);
result:=HttpOpenRequest(opHttpSession, PChar(sVerb), PChar(sUrl),
nil, nil, nil, INTERNET_FLAG_SECURE or INTERNET_FLAG_KEEP_CONNECTION or
INTERNET_FLAG_NO_CACHE_WRITE or INTERNET_FLAG_IGNORE_CERT_CN_INVALID,
0);
Later we use this function
if (bNewRequest) or (opReqSession = nil) then
opReqSession:=GetRequest(sUrl, sVerb);
iLastError:=0;
sHeader:=FormatHeader(ssHeader);
FillChar(OutBuffer, SizeOf(OutBuffer), 0);
OutBuffer.dwStructSize:=SizeOf(OutBuffer);
OutBuffer.lpcszHeader:=PChar(sHeader);
OutBuffer.dwHeadersLength:=Length(sHeader);
OutBuffer.dwBufferTotal:=Length(aData);
if HttpSendRequestEx(opReqSession, @OutBuffer, nil, HSR_INITIATE or
HSR_SYNC, 0) then
begin
// Some stuff
if iLastError = 0 then
begin
if not HttpEndRequest(opReqSession, nil, HSR_SYNC, 0) then
begin
iLastError:=GetLastError;
if iLastError = 12030 then
begin
Self.AddLog('Http Error Encountered, ignoring...
('+IntToStr(iLastError)+')');
iLastError:=0;
end;
end;
end;
end
else
iLastError:=GetLastError;
if iLastError <> 0 then
begin
iWebError:=GetQueryInfo(opReqSession);
Self.AddLog('Http Error Encountered, retrying...
('+IntToStr(iLastError)+', '+IntToStr(iWebError)+')');
SendRequest(sUrl, sVerb, ssHeader, aData, false);
end;
else
raise TtcException.Create(ClassType, 'SendRequest', 'Error during
request ('+IntToStr(iLastError)+', '+IntToStr(iWebError)+')');
end;
end;
end;
end
else
iLastError:=GetLastError;
if iLastError <> 0 then
begin
iWebError:=GetQueryInfo(opReqSession);
case iWebError div 100 of
4, 5:
// 401, //
// 500, // internal server error
// 502, // bad gateway
// 503, // service unavailable
// 504: // gateway timeout
begin
Self.AddLog('Http Error Encountered, retrying...
('+IntToStr(iLastError)+', '+IntToStr(iWebError)+')');
SendRequest(sUrl, sVerb, ssHeader, aData, false);
end;
else
raise TtcException.Create(ClassType, 'SendRequest', 'Error during
request ('+IntToStr(iLastError)+', '+IntToStr(iWebError)+')');
end;
end;
end;
I really appreciate your help with this.