Branch: Tag:

2014-07-13

2014-07-13 10:26:02 by Henrik Grubbström (Grubba) <grubba@grubba.org>

SSL.Connection: Added query_write_queue_size().

This provides an easy API to see whether it is meaningful to
call to_write().

429:      }    + //! Returns the number of packets queued for writing. + //! + //! @returns + //! Returns the number of times @[to_write()] can be called before + //! it stops returning non-empty strings. + int query_write_queue_size() + { +  return sizeof(alert_q) + sizeof(urgent_q) + sizeof(application_q); + } +    //! Extracts data from the packet queues. Returns a string of data   //! to be written, "" if there are no pending packets, 1 of the   //! connection is being closed politely, and -1 if the connection   //! died unexpectedly.   //!   //! This function is intended to be called from an i/o write callback. -  + //! + //! @seealso + //! @[query_write_queue_size()], @[send_streaming_data()].   string|int to_write()   {    if (state & CONNECTION_local_fatal)