Branch: Tag:

2015-03-31

2015-03-31 05:43:43 by Martin Nilsson <nilsson@opera.com>

Change to_write API to return 0 on no data instead of empty string.

606:   }      //! Extracts data from the packet queues. Returns a string of data - //! to be written, "" if there are no pending packets, 1 of the + //! to be written, 0 if there are no pending packets, 1 of the   //! connection is being closed politely, and -1 if the connection   //! died unexpectedly.   //!
621:       Packet packet = [object(Packet)](alert_q->get() || urgent_q->get() ||    application_q->get()); -  if (!packet) { -  return (state & CONNECTION_local_closing) ? 1 : ""; -  } +  if (!packet) +  return !!(state & CONNECTION_local_closing);       SSL3_DEBUG_MSG("SSL.Connection: writing packet of type %d, %O\n",    packet->content_type, packet->fragment[..6]);