diff options
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -25,7 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "includes.h" | 27 | #include "includes.h" |
28 | RCSID("$OpenBSD: monitor.c,v 1.15 2002/06/19 18:01:00 markus Exp $"); | 28 | RCSID("$OpenBSD: monitor.c,v 1.16 2002/06/21 05:50:51 djm Exp $"); |
29 | 29 | ||
30 | #include <openssl/dh.h> | 30 | #include <openssl/dh.h> |
31 | 31 | ||
@@ -327,8 +327,10 @@ monitor_child_postauth(struct monitor *pmonitor) | |||
327 | void | 327 | void |
328 | monitor_sync(struct monitor *pmonitor) | 328 | monitor_sync(struct monitor *pmonitor) |
329 | { | 329 | { |
330 | /* The member allocation is not visible, so sync it */ | 330 | if (options.compression) { |
331 | mm_share_sync(&pmonitor->m_zlib, &pmonitor->m_zback); | 331 | /* The member allocation is not visible, so sync it */ |
332 | mm_share_sync(&pmonitor->m_zlib, &pmonitor->m_zback); | ||
333 | } | ||
332 | } | 334 | } |
333 | 335 | ||
334 | int | 336 | int |
@@ -1330,7 +1332,8 @@ monitor_apply_keystate(struct monitor *pmonitor) | |||
1330 | sizeof(outgoing_stream)); | 1332 | sizeof(outgoing_stream)); |
1331 | 1333 | ||
1332 | /* Update with new address */ | 1334 | /* Update with new address */ |
1333 | mm_init_compression(pmonitor->m_zlib); | 1335 | if (options.compression) |
1336 | mm_init_compression(pmonitor->m_zlib); | ||
1334 | 1337 | ||
1335 | /* Network I/O buffers */ | 1338 | /* Network I/O buffers */ |
1336 | /* XXX inefficient for large buffers, need: buffer_init_from_string */ | 1339 | /* XXX inefficient for large buffers, need: buffer_init_from_string */ |
@@ -1515,11 +1518,13 @@ monitor_init(void) | |||
1515 | mon->m_sendfd = pair[1]; | 1518 | mon->m_sendfd = pair[1]; |
1516 | 1519 | ||
1517 | /* Used to share zlib space across processes */ | 1520 | /* Used to share zlib space across processes */ |
1518 | mon->m_zback = mm_create(NULL, MM_MEMSIZE); | 1521 | if (options.compression) { |
1519 | mon->m_zlib = mm_create(mon->m_zback, 20 * MM_MEMSIZE); | 1522 | mon->m_zback = mm_create(NULL, MM_MEMSIZE); |
1523 | mon->m_zlib = mm_create(mon->m_zback, 20 * MM_MEMSIZE); | ||
1520 | 1524 | ||
1521 | /* Compression needs to share state across borders */ | 1525 | /* Compression needs to share state across borders */ |
1522 | mm_init_compression(mon->m_zlib); | 1526 | mm_init_compression(mon->m_zlib); |
1527 | } | ||
1523 | 1528 | ||
1524 | return mon; | 1529 | return mon; |
1525 | } | 1530 | } |