32
32
str = t_str_new(512);
33
33
str_printfa(str, "AUTH\t%u\t", request->id);
34
str_tabescape_write(str, info->mech);
34
str_append_tabescaped(str, info->mech);
35
35
str_append(str, "\tservice=");
36
str_tabescape_write(str, info->service);
36
str_append_tabescaped(str, info->service);
38
38
if ((info->flags & AUTH_REQUEST_FLAG_SUPPORT_FINAL_RESP) != 0)
39
39
str_append(str, "\tfinal-resp-ok");
47
47
if (info->session_id != NULL) {
48
48
str_append(str, "\tsession=");
49
str_tabescape_write(str, info->session_id);
49
str_append_tabescaped(str, info->session_id);
51
51
if (info->cert_username != NULL) {
52
52
str_append(str, "\tcert_username=");
53
str_tabescape_write(str, info->cert_username);
53
str_append_tabescaped(str, info->cert_username);
55
55
if (info->local_ip.family != 0)
56
56
str_printfa(str, "\tlip=%s", net_ip2addr(&info->local_ip));
60
60
str_printfa(str, "\tlport=%u", info->local_port);
61
61
if (info->remote_port != 0)
62
62
str_printfa(str, "\trport=%u", info->remote_port);
64
/* send the real_* variants only when they differ from the unreal
66
if (info->real_local_ip.family != 0 &&
67
!net_ip_compare(&info->real_local_ip, &info->local_ip)) {
68
str_printfa(str, "\treal_lip=%s",
69
net_ip2addr(&info->real_local_ip));
71
if (info->real_remote_ip.family != 0 &&
72
!net_ip_compare(&info->real_remote_ip, &info->remote_ip)) {
73
str_printfa(str, "\treal_rip=%s",
74
net_ip2addr(&info->real_remote_ip));
76
if (info->real_local_port != 0 &&
77
info->real_local_port != info->local_port)
78
str_printfa(str, "\treal_lport=%u", info->real_local_port);
79
if (info->real_remote_port != 0 &&
80
info->real_remote_port != info->remote_port)
81
str_printfa(str, "\treal_rport=%u", info->real_remote_port);
63
83
if (info->initial_resp_base64 != NULL) {
64
84
str_append(str, "\tresp=");
65
str_tabescape_write(str, info->initial_resp_base64);
85
str_append_tabescaped(str, info->initial_resp_base64);
67
87
str_append_c(str, '\n');
124
144
i_error("Error sending continue request to auth server: %m");
127
static void call_callback(struct auth_client_request *request,
128
enum auth_request_status status,
129
const char *data_base64,
130
const char *const *args)
147
static void ATTR_NULL(3, 4)
148
call_callback(struct auth_client_request *request,
149
enum auth_request_status status,
150
const char *data_base64,
151
const char *const *args)
132
153
auth_request_callback_t *callback = request->callback;