Crypt-Bear

 view release on metacpan or  search on metacpan

include/bearssl_ssl.h  view on Meta::CPAN

 * \brief Flush buffered application data.
 *
 * If some application data has been buffered in the engine, then wrap
 * it into a record and mark it for sending. If no application data has
 * been buffered but the engine would be ready to accept some, AND the
 * `force` parameter is non-zero, then an empty record is assembled and
 * marked for sending. In all other cases, this function does nothing.
 *
 * Empty records are technically legal, but not all existing SSL/TLS
 * implementations support them. Empty records can be useful as a
 * transparent "keep-alive" mechanism to maintain some low-level
 * network activity.
 *
 * \param cc      SSL engine context.
 * \param force   non-zero to force sending an empty record.
 */
void br_ssl_engine_flush(br_ssl_engine_context *cc, int force);

/**
 * \brief Initiate a closure.
 *

lib/Crypt/Bear/SSL/Engine.pm  view on Meta::CPAN

=head2 push_send($data, $flush = false)

This pushes (unencrypted) application data into the buffer, and returns (encrypted) records to be sent over your socket. If C<$flush> is true and any application data is buffered in the system, it will wrap it up into a record and immediately output ...

=head2 push_received($data)

This pushed (encrypted) records received from the socket into the buffer, and returns the (decrypted) applicatoin data.

=head2 pull_send($flush = false)

This will pull any pending records to be send to the other side. This is primarily useful around opening and closing connections when data can't be send yet. If C<$flush> is true, it will create an empty record if no pending data is available, this c...

=head2 send_ready()

This returns true if the connection is ready for application data to be pushed in to be sent to the other side. This is useful to know when you're done connecting. Note that this can also be false when the send buffer is full, sp so it's not very use...

=head2 is_closed()

This returns true if the connection is closed. If this is unexpected you should probably call C<last_error> as well to find out why.

=head2 close()

src/ssl/ssl_engine.c  view on Meta::CPAN

		/*
		 * If the record is completely empty then we must switch
		 * to a new record. Note that, in that case, we
		 * completely ignore the record type, which is fitting
		 * since we received no actual data of that type.
		 *
		 * A completely empty record is technically allowed as
		 * long as encryption/MAC is not active, i.e. before
		 * completion of the first handshake. It it still weird;
		 * it might conceptually be useful as a heartbeat or
		 * keep-alive mechanism while some lengthy operation is
		 * going on, e.g. interaction with a human user.
		 */
		if (rlen == 0) {
			make_ready_in(rc);
		} else {
			rc->ixa = rc->ixb = 5;
			rc->ixc = rlen;
		}
		return;
	}



( run in 0.890 second using v1.01-cache-2.11-cpan-39bf76dae61 )