Skip to content
Snippets Groups Projects
Commit ed871b99 authored by Howard Chu's avatar Howard Chu
Browse files

Break up large SASL writes into units of SASL maxoutbuf size.

parent 931c4eb3
Branches
Tags
No related merge requests found
......@@ -291,6 +291,7 @@ sb_sasl_write( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
{
struct sb_sasl_data *p;
int ret;
unsigned *max;
assert( sbiod != NULL );
assert( SOCKBUF_VALID( sbiod->sbiod_sb ) );
......@@ -310,6 +311,9 @@ sb_sasl_write( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
#else
ber_pvt_sb_buf_destroy( &p->buf_out );
#endif
sasl_getprop( p->sasl_context, SASL_MAXOUTBUF, (const void **)&max );
if ( len > *max )
len = *max - 100; /* For safety margin */
ret = sasl_encode( p->sasl_context, buf, len,
(SASL_CONST char **)&p->buf_out.buf_base,
(unsigned *)&p->buf_out.buf_size );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment