mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-25 06:16:37 +01:00
Merge pull request #758 from GaborApatiNagy/CA-148491
CA-148491: XenServer breaks if any XenAPI client leaks sessions
This commit is contained in:
commit
5d5e242018
@ -68,7 +68,7 @@ namespace XenServerHealthCheck
|
||||
|
||||
try
|
||||
{
|
||||
session.login_with_password(connection.Username, connection.Password);
|
||||
session.login_with_password(connection.Username, connection.Password, Helper.APIVersionString(API_Version.LATEST), Session.UserAgent);
|
||||
connection.LoadCache(session);
|
||||
var pool = Helpers.GetPoolOfOne(connection);
|
||||
if (pool != null)
|
||||
@ -187,7 +187,7 @@ namespace XenServerHealthCheck
|
||||
public void updateHealthCheckSettings(bool success, DateTime time, string uploadUuid = "")
|
||||
{
|
||||
Session session = new Session(connection.Hostname, 80);
|
||||
session.login_with_password(connection.Username, connection.Password);
|
||||
session.login_with_password(connection.Username, connection.Password, Helper.APIVersionString(API_Version.LATEST), Session.UserAgent);
|
||||
connection.LoadCache(session);
|
||||
|
||||
// Round-trip format time
|
||||
|
@ -48,6 +48,9 @@ namespace XenServerHealthCheck
|
||||
{
|
||||
InitializeComponent();
|
||||
AutoLog = false;
|
||||
|
||||
XenAPI.Session.UserAgent = string.Format("XenServerHealthCheck/API-{0}", API_Version.LATEST);
|
||||
|
||||
if (!System.Diagnostics.EventLog.SourceExists("XenServerHealthCheck"))
|
||||
{
|
||||
System.Diagnostics.EventLog.CreateEventSource(
|
||||
@ -131,7 +134,7 @@ namespace XenServerHealthCheck
|
||||
session.APIVersion = API_Version.LATEST;
|
||||
try
|
||||
{
|
||||
session.login_with_password(server.UserName, server.Password);
|
||||
session.login_with_password(server.UserName, server.Password, Helper.APIVersionString(API_Version.LATEST), Session.UserAgent);
|
||||
}
|
||||
catch (Exception exn)
|
||||
{
|
||||
@ -171,7 +174,7 @@ namespace XenServerHealthCheck
|
||||
log.InfoFormat("Reconnect to master {0}", server.HostName);
|
||||
session = new Session(server.HostName, 80);
|
||||
session.APIVersion = API_Version.LATEST;
|
||||
session.login_with_password(server.UserName, server.Password);
|
||||
session.login_with_password(server.UserName, server.Password, Helper.APIVersionString(API_Version.LATEST), Session.UserAgent);
|
||||
}
|
||||
XenConnection connectionInfo = new XenConnection();
|
||||
connectionInfo.Hostname = server.HostName;
|
||||
|
Loading…
Reference in New Issue
Block a user