Revision a7789382
b/vnc.c | ||
---|---|---|
122 | 122 |
return 0; |
123 | 123 |
} |
124 | 124 |
|
125 |
static int vnc_qdict_local_addr(QDict *qdict, int fd)
|
|
125 |
static int vnc_server_addr_put(QDict *qdict, int fd)
|
|
126 | 126 |
{ |
127 | 127 |
struct sockaddr_storage sa; |
128 | 128 |
socklen_t salen; |
... | ... | |
199 | 199 |
return "unknown"; |
200 | 200 |
} |
201 | 201 |
|
202 |
static int vnc_server_info_put(QDict *qdict) |
|
203 |
{ |
|
204 |
if (vnc_server_addr_put(qdict, vnc_display->lsock) < 0) { |
|
205 |
return -1; |
|
206 |
} |
|
207 |
|
|
208 |
qdict_put(qdict, "auth", qstring_from_str(vnc_auth_name(vnc_display))); |
|
209 |
return 0; |
|
210 |
} |
|
211 |
|
|
202 | 212 |
static QDict *do_info_vnc_client(Monitor *mon, VncState *client) |
203 | 213 |
{ |
204 | 214 |
QDict *qdict; |
... | ... | |
263 | 273 |
monitor_printf(mon, " address: %s:%s\n", |
264 | 274 |
qdict_get_str(server, "host"), |
265 | 275 |
qdict_get_str(server, "service")); |
266 |
monitor_printf(mon, " auth: %s\n", |
|
267 |
qdict_haskey(server, "auth") ? qdict_get_str(server, "auth") : "none"); |
|
276 |
monitor_printf(mon, " auth: %s\n", qdict_get_str(server, "auth")); |
|
268 | 277 |
|
269 | 278 |
clients = qdict_get_qlist(server, "clients"); |
270 | 279 |
if (qlist_empty(clients)) { |
... | ... | |
285 | 294 |
* - "enabled": true or false |
286 | 295 |
* - "host": server's IP address |
287 | 296 |
* - "service": server's port number |
288 |
* - "auth": authentication method (optional)
|
|
297 |
* - "auth": authentication method |
|
289 | 298 |
* - "clients": a QList of all connected clients |
290 | 299 |
* |
291 | 300 |
* Clients are described by a QDict, with the following information: |
... | ... | |
323 | 332 |
QOBJECT(clist)); |
324 | 333 |
assert(*ret_data != NULL); |
325 | 334 |
|
326 |
qdict = qobject_to_qdict(*ret_data); |
|
327 |
|
|
328 |
if (vnc_display->auth != VNC_AUTH_NONE) { |
|
329 |
qdict_put(qdict, "auth", |
|
330 |
qstring_from_str(vnc_auth_name(vnc_display))); |
|
331 |
} |
|
332 |
|
|
333 |
if (vnc_qdict_local_addr(qdict, vnc_display->lsock) < 0) { |
|
335 |
if (vnc_server_info_put(qobject_to_qdict(*ret_data)) < 0) { |
|
334 | 336 |
qobject_decref(*ret_data); |
335 | 337 |
*ret_data = NULL; |
336 | 338 |
} |
Also available in: Unified diff