… | |
… | |
266 | |
266 | |
267 | =item filter_r => $cb |
267 | =item filter_r => $cb |
268 | |
268 | |
269 | =item filter_w => $cb |
269 | =item filter_w => $cb |
270 | |
270 | |
271 | These exist, but are undocumented at this time. |
271 | These exist, but are undocumented at this time. (They are used internally |
|
|
272 | by the TLS code). |
272 | |
273 | |
273 | =back |
274 | =back |
274 | |
275 | |
275 | =cut |
276 | =cut |
276 | |
277 | |
… | |
… | |
1367 | # basically, this is deep magic (because SSL_read should have the same issues) |
1368 | # basically, this is deep magic (because SSL_read should have the same issues) |
1368 | # but the openssl maintainers basically said: "trust us, it just works". |
1369 | # but the openssl maintainers basically said: "trust us, it just works". |
1369 | # (unfortunately, we have to hardcode constants because the abysmally misdesigned |
1370 | # (unfortunately, we have to hardcode constants because the abysmally misdesigned |
1370 | # and mismaintained ssleay-module doesn't even offer them). |
1371 | # and mismaintained ssleay-module doesn't even offer them). |
1371 | # http://www.mail-archive.com/openssl-dev@openssl.org/msg22420.html |
1372 | # http://www.mail-archive.com/openssl-dev@openssl.org/msg22420.html |
|
|
1373 | # |
|
|
1374 | # in short: this is a mess. |
|
|
1375 | # |
|
|
1376 | # note that we do not try to kepe the length constant between writes as we are required to do. |
|
|
1377 | # we assume that most (but not all) of this insanity only applies to non-blocking cases, |
|
|
1378 | # and we drive openssl fully in blocking mode here. |
1372 | Net::SSLeay::CTX_set_mode ($self->{tls}, |
1379 | Net::SSLeay::CTX_set_mode ($self->{tls}, |
1373 | (eval { local $SIG{__DIE__}; Net::SSLeay::MODE_ENABLE_PARTIAL_WRITE () } || 1) |
1380 | (eval { local $SIG{__DIE__}; Net::SSLeay::MODE_ENABLE_PARTIAL_WRITE () } || 1) |
1374 | | (eval { local $SIG{__DIE__}; Net::SSLeay::MODE_ACCEPT_MOVING_WRITE_BUFFER () } || 2)); |
1381 | | (eval { local $SIG{__DIE__}; Net::SSLeay::MODE_ACCEPT_MOVING_WRITE_BUFFER () } || 2)); |
1375 | |
1382 | |
1376 | $self->{_rbio} = Net::SSLeay::BIO_new (Net::SSLeay::BIO_s_mem ()); |
1383 | $self->{_rbio} = Net::SSLeay::BIO_new (Net::SSLeay::BIO_s_mem ()); |