Patch level :2.0 nopatch

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :aggiunte modifiche per trasferimento dati discolatio (come su 1.7)


git-svn-id: svn://10.65.10.50/trunk@11047 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2003-04-22 15:06:36 +00:00
parent ffbd6f8588
commit d4c8418c20
4 changed files with 15 additions and 11 deletions

View File

@ -316,7 +316,8 @@ bool rpc_UserLogout()
bool http_get(const char* server, bool http_get(const char* server,
const char* remote_file, const char* remote_file,
const char* local_file) const char* local_file,
const char* authorization)
{ {
TSocketClient client; TSocketClient client;
if (!client.IsOk()) if (!client.IsOk())
@ -326,7 +327,7 @@ bool http_get(const char* server,
bool ok = connection != 0; bool ok = connection != 0;
if (ok) if (ok)
{ {
ok = client.HttpGetFile(connection, remote_file, local_file) != 0; ok = client.HttpGetFile(connection, remote_file, local_file, authorization) != 0;
client.RemoveConnection(connection); client.RemoveConnection(connection);
} }
@ -353,7 +354,8 @@ bool http_dir(const char* server, const char* remote_dir, TString_array& list)
} }
bool http_post(const char* server, const char* remote_file, bool http_post(const char* server, const char* remote_file,
const char* local_file, const char* authorization) const char* local_file, const char* authorization,
byte*& answer, size_t& length)
{ {
TSocketClient client; TSocketClient client;
if (!client.IsOk()) if (!client.IsOk())
@ -375,16 +377,16 @@ bool http_post(const char* server, const char* remote_file,
{ {
ok = client.HttpPostFile(connection, remote_file, local_file, authorization) != 0; ok = client.HttpPostFile(connection, remote_file, local_file, authorization) != 0;
client.RemoveConnection(connection); client.RemoveConnection(connection);
answer = client.GetBuffer(length);
if (!ok) if (!ok)
{ {
size_t dwSize = 0;
const char* err = (const char*)client.GetBuffer(dwSize);
error_box("Impossibile spedire il file %s al server %s:\n%s", error_box("Impossibile spedire il file %s al server %s:\n%s",
local_file, server, err); local_file, server, answer);
client.ReleaseBuffer();
} }
} }
else else
return error_box("Impossibile connettersi al server %s", server); return error_box("Impossibile connettersi al server %s", server);
return ok; return ok;
} }

View File

@ -24,9 +24,11 @@ bool rpc_UserLogout();
bool rpc_Start(); bool rpc_Start();
bool rpc_Stop(); bool rpc_Stop();
bool http_get(const char* server, const char* remote_file, const char* local_file); bool http_get(const char* server, const char* remote_file,
const char* local_file, const char* authorization = NULL);
bool http_dir(const char* server, const char* remote_dir, TString_array & list); bool http_dir(const char* server, const char* remote_dir, TString_array & list);
bool http_post(const char* server, const char* remote_file, bool http_post(const char* server, const char* remote_file,
const char* local_file, const char* authorization = NULL); const char* local_file, const char* authorization,
byte*& answer, size_t& length);
#endif #endif

View File

@ -678,7 +678,7 @@ void TSocketClient::ReleaseBuffer()
} }
} }
bool TSocketClient::HttpGetFile(CONNID id, const char* remote, const char* local) bool TSocketClient::HttpGetFile(CONNID id, const char* remote, const char* local, const char* authorization)
{ {
bool ok = FALSE; bool ok = FALSE;

View File

@ -47,7 +47,7 @@ public:
bool WriteLine(CONNID id, const char* str); bool WriteLine(CONNID id, const char* str);
bool ReadLine(CONNID id, TString& str); bool ReadLine(CONNID id, TString& str);
bool HttpGetFile(CONNID id, const char* remote, const char* local); bool HttpGetFile(CONNID id, const char* remote, const char* local, const char* authorization = NULL);
bool HttpGetDir(CONNID id, const char* remote, TString_array& list); bool HttpGetDir(CONNID id, const char* remote, TString_array& list);
bool HttpSoap(CONNID id, const char* query); bool HttpSoap(CONNID id, const char* query);
bool HttpPostFile(CONNID id, const char* remote, const char* local, const char* authorization = NULL); bool HttpPostFile(CONNID id, const char* remote, const char* local, const char* authorization = NULL);