Patch level :2.0 partners 626

Files correlati     :ba1.exe
Ricompilazione Demo : [ ]
Commento            :aggiunta modifica necessaria x aggiornare dalla directory release via
web;il tag <href> deve poter essere letto sia minuscolo che maiuscolo (problema sorto con
l'aggiornamento dell'http server su savik)


git-svn-id: svn://10.65.10.50/trunk@11545 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2003-10-28 15:53:38 +00:00
parent 35abf9e371
commit 205436a6b1

View File

@ -739,6 +739,21 @@ bool TSocketClient::HttpGetFile(CONNID id, const char* remote, const char* local
return ok; return ok;
} }
HIDDEN int find_href(const TString& riga)
{
int href = -1;
int img = riga.find("<img");
if (img >= 0)
href = riga.find("href=", img+4);
else
{
img = riga.find("<IMG");
if (img >= 0)
href = riga.find("HREF=", img+4);
}
return href;
}
bool TSocketClient::HttpGetDir(CONNID id, const char* remote, TString_array& list) bool TSocketClient::HttpGetDir(CONNID id, const char* remote, TString_array& list)
{ {
TFilename local; local.temp(); TFilename local; local.temp();
@ -750,9 +765,8 @@ bool TSocketClient::HttpGetDir(CONNID id, const char* remote, TString_array& lis
while (!s.eof()) while (!s.eof())
{ {
s.getline(riga.get_buffer(), riga.size()); s.getline(riga.get_buffer(), riga.size());
const int img = riga.find("<IMG"); const int href = find_href(riga);
const int href = riga.find("HREF="); if (href > 0)
if (img >= 0 && href > img)
{ {
const int start = riga.find('"', href) + 1; const int start = riga.find('"', href) + 1;
if (start > href && isalnum(riga[start + 1])) if (start > href && isalnum(riga[start + 1]))