From 35c19ded1b7679da31dd1429e94837983d96f1d5 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Sun, 24 Feb 2013 09:13:09 +0200 Subject: [PATCH] http: simplify Single Sign-On handling Document that Single Sign-On is only used when HttpConnAuth is NULL. --- src/core/http-conn.c | 10 +++++----- src/core/http-conn.h | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/core/http-conn.c b/src/core/http-conn.c index 9304aac9..e665965e 100644 --- a/src/core/http-conn.c +++ b/src/core/http-conn.c @@ -445,7 +445,7 @@ http_conn_process_input_message(HttpConn *http_conn, const char *auth_name; char *authorization; char *output_toked_base64; - int use_sso = !http_conn->auth || !http_conn->auth->user; + HttpConnAuth *auth = http_conn->auth; long ret = -1; http_conn->retries++; @@ -496,11 +496,11 @@ http_conn_process_input_message(HttpConn *http_conn, if (!http_conn->sec_ctx) { http_conn->sec_ctx = sip_sec_create_context(auth_type, - use_sso, + auth == NULL, /* Single Sign-On flag */ TRUE, /* connection-based for HTTP */ - http_conn->auth && http_conn->auth->domain ? http_conn->auth->domain : "", - http_conn->auth ? http_conn->auth->user : NULL, - http_conn->auth ? http_conn->auth->password : NULL); + auth ? auth->domain : NULL, + auth ? auth->user : NULL, + auth ? auth->password : NULL); } if (http_conn->sec_ctx) { diff --git a/src/core/http-conn.h b/src/core/http-conn.h index 30f92729..f8db0611 100644 --- a/src/core/http-conn.h +++ b/src/core/http-conn.h @@ -3,7 +3,7 @@ * * pidgin-sipe * - * Copyright (C) 2010-13 SIPE Project + * Copyright (C) 2010-2013 SIPE Project * Copyright (C) 2009 pier11 * * This program is free software; you can redistribute it and/or modify @@ -54,6 +54,8 @@ typedef void (*HttpConnCallback) (int return_code, const char *body, GSList* hea /** * Creates SSL connection and sends. + * + * @param auth Authentication data. Must be @c NULL for Single Sign-On */ HttpConn * http_conn_create(struct sipe_core_public *sipe_public, -- 2.11.4.GIT