[sr-dev] git:andrei/tcp_tls_changes: tcp: change tls send callback interface

Andrei Pelinescu-Onciul andrei at iptel.org
Wed Jun 23 23:47:29 CEST 2010


Module: sip-router
Branch: andrei/tcp_tls_changes
Commit: 5f65308938f456770638ed5bac4768f94391005b
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5f65308938f456770638ed5bac4768f94391005b

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Wed Jun 23 23:17:15 2010 +0200

tcp: change tls send callback interface

Instead of 2 different tls send callbacks (with a 3rd one needed),
switch to a different model: 1 tls callback that is supposed to
replace the passed buffer with a tls processed version of it.
This simplifies the tls code and more importantly doesn't require
that the tls send code has very detailed knowledge about the tcp
state machine. Some of the saved complexity moved from the tls
module to the tcp code, but at least this way on changes there's
only one place to update.
The tls callbacks for reading and sending are now very different:
while the send callback has become now more of an encoder
callback, the read callback should still perform the tcp read by
itself. While this is not very consistent it does saves unneeded
memory copies.

---

 tcp_int_send.h |   12 +----
 tcp_main.c     |  141 +++++++++++++++++++++++++++++++++++++++++---------------
 tcp_server.h   |    2 +-
 tls_hooks.c    |    2 +-
 tls_hooks.h    |   23 ++++-----
 5 files changed, 119 insertions(+), 61 deletions(-)

Diff:   http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=5f65308938f456770638ed5bac4768f94391005b



More information about the sr-dev mailing list