|
1 | | -/* $OpenBSD: monitor.c,v 1.165 2016/09/05 13:57:31 djm Exp $ */ |
| 1 | +/* $OpenBSD: monitor.c,v 1.166 2016/09/28 16:33:06 djm Exp $ */ |
2 | 2 | /* |
3 | 3 | * Copyright 2002 Niels Provos <provos@citi.umich.edu> |
4 | 4 | * Copyright 2002 Markus Friedl <markus@openbsd.org> |
|
70 | 70 | #include "misc.h" |
71 | 71 | #include "servconf.h" |
72 | 72 | #include "monitor.h" |
73 | | -#include "monitor_mm.h" |
74 | 73 | #ifdef GSSAPI |
75 | 74 | #include "ssh-gss.h" |
76 | 75 | #endif |
@@ -335,31 +334,6 @@ monitor_child_postauth(struct monitor *pmonitor) |
335 | 334 | monitor_read(pmonitor, mon_dispatch, NULL); |
336 | 335 | } |
337 | 336 |
|
338 | | -void |
339 | | -monitor_sync(struct monitor *pmonitor) |
340 | | -{ |
341 | | - if (options.compression) { |
342 | | - /* The member allocation is not visible, so sync it */ |
343 | | - mm_share_sync(&pmonitor->m_zlib, &pmonitor->m_zback); |
344 | | - } |
345 | | -} |
346 | | - |
347 | | -/* Allocation functions for zlib */ |
348 | | -static void * |
349 | | -mm_zalloc(struct mm_master *mm, u_int ncount, u_int size) |
350 | | -{ |
351 | | - if (size == 0 || ncount == 0 || ncount > SIZE_MAX / size) |
352 | | - fatal("%s: mm_zalloc(%u, %u)", __func__, ncount, size); |
353 | | - |
354 | | - return mm_malloc(mm, size * ncount); |
355 | | -} |
356 | | - |
357 | | -static void |
358 | | -mm_zfree(struct mm_master *mm, void *address) |
359 | | -{ |
360 | | - mm_free(mm, address); |
361 | | -} |
362 | | - |
363 | 337 | static int |
364 | 338 | monitor_read_log(struct monitor *pmonitor) |
365 | 339 | { |
@@ -1292,13 +1266,6 @@ monitor_apply_keystate(struct monitor *pmonitor) |
1292 | 1266 | kex->host_key_index=&get_hostkey_index; |
1293 | 1267 | kex->sign = sshd_hostkey_sign; |
1294 | 1268 | } |
1295 | | - |
1296 | | - /* Update with new address */ |
1297 | | - if (options.compression) { |
1298 | | - ssh_packet_set_compress_hooks(ssh, pmonitor->m_zlib, |
1299 | | - (ssh_packet_comp_alloc_func *)mm_zalloc, |
1300 | | - (ssh_packet_comp_free_func *)mm_zfree); |
1301 | | - } |
1302 | 1269 | } |
1303 | 1270 |
|
1304 | 1271 | /* This function requries careful sanity checking */ |
@@ -1351,24 +1318,11 @@ monitor_openfds(struct monitor *mon, int do_logfds) |
1351 | 1318 | struct monitor * |
1352 | 1319 | monitor_init(void) |
1353 | 1320 | { |
1354 | | - struct ssh *ssh = active_state; /* XXX */ |
1355 | 1321 | struct monitor *mon; |
1356 | 1322 |
|
1357 | 1323 | mon = xcalloc(1, sizeof(*mon)); |
1358 | | - |
1359 | 1324 | monitor_openfds(mon, 1); |
1360 | 1325 |
|
1361 | | - /* Used to share zlib space across processes */ |
1362 | | - if (options.compression) { |
1363 | | - mon->m_zback = mm_create(NULL, MM_MEMSIZE); |
1364 | | - mon->m_zlib = mm_create(mon->m_zback, 20 * MM_MEMSIZE); |
1365 | | - |
1366 | | - /* Compression needs to share state across borders */ |
1367 | | - ssh_packet_set_compress_hooks(ssh, mon->m_zlib, |
1368 | | - (ssh_packet_comp_alloc_func *)mm_zalloc, |
1369 | | - (ssh_packet_comp_free_func *)mm_zfree); |
1370 | | - } |
1371 | | - |
1372 | 1326 | return mon; |
1373 | 1327 | } |
1374 | 1328 |
|
|
0 commit comments