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:
parent
ffbd6f8588
commit
d4c8418c20
@ -316,7 +316,8 @@ bool rpc_UserLogout()
|
||||
|
||||
bool http_get(const char* server,
|
||||
const char* remote_file,
|
||||
const char* local_file)
|
||||
const char* local_file,
|
||||
const char* authorization)
|
||||
{
|
||||
TSocketClient client;
|
||||
if (!client.IsOk())
|
||||
@ -326,7 +327,7 @@ bool http_get(const char* server,
|
||||
bool ok = connection != 0;
|
||||
if (ok)
|
||||
{
|
||||
ok = client.HttpGetFile(connection, remote_file, local_file) != 0;
|
||||
ok = client.HttpGetFile(connection, remote_file, local_file, authorization) != 0;
|
||||
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,
|
||||
const char* local_file, const char* authorization)
|
||||
const char* local_file, const char* authorization,
|
||||
byte*& answer, size_t& length)
|
||||
{
|
||||
TSocketClient client;
|
||||
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;
|
||||
client.RemoveConnection(connection);
|
||||
answer = client.GetBuffer(length);
|
||||
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",
|
||||
local_file, server, err);
|
||||
client.ReleaseBuffer();
|
||||
local_file, server, answer);
|
||||
}
|
||||
}
|
||||
else
|
||||
return error_box("Impossibile connettersi al server %s", server);
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
|
@ -24,9 +24,11 @@ bool rpc_UserLogout();
|
||||
bool rpc_Start();
|
||||
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_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
|
@ -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;
|
||||
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
bool WriteLine(CONNID id, const char* 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 HttpSoap(CONNID id, const char* query);
|
||||
bool HttpPostFile(CONNID id, const char* remote, const char* local, const char* authorization = NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user