forked from Mirrors/freeswitch
Tue Jan 13 16:22:39 CST 2009 Pekka Pessi <first.last@nokia.com>
* tport_type_tls.c, tport_tls.c: added Jarod Neuner as one of authors Cleaned whitespace, too. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11822 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
ec1024d619
commit
90311fbd2d
@ -1 +1 @@
|
||||
Wed Feb 11 10:55:01 CST 2009
|
||||
Wed Feb 11 11:00:10 CST 2009
|
||||
|
@ -27,8 +27,7 @@
|
||||
*
|
||||
* @author Mikko Haataja <ext-Mikko.A.Haataja@nokia.com>
|
||||
* @author Pekka Pessi <ext-Pekka.Pessi@nokia.com>
|
||||
*
|
||||
* Copyright 2001, 2002 Nokia Research Center. All rights reserved.
|
||||
* @author Jarod Neuner <janeuner@networkharbor.com>
|
||||
*
|
||||
*/
|
||||
|
||||
@ -696,7 +695,7 @@ int tls_connect(su_root_magic_t *magic, su_wait_t *w, tport_t *self)
|
||||
int events = su_wait_events(w, self->tp_socket);
|
||||
int error;
|
||||
|
||||
SU_DEBUG_7(("%s(%p): events%s%s%s%s\n", __func__, (void *)self,
|
||||
SU_DEBUG_7(("%s(%p): events%s%s%s%s\n", __func__, (void *)self,
|
||||
events & (SU_WAIT_CONNECT) ? " CONNECTING" : "",
|
||||
events & SU_WAIT_IN ? " NEGOTIATING" : "",
|
||||
events & SU_WAIT_ERR ? " ERROR" : "",
|
||||
@ -722,7 +721,7 @@ int tls_connect(su_root_magic_t *magic, su_wait_t *w, tport_t *self)
|
||||
}
|
||||
|
||||
if ((tls = tlstp->tlstp_context) == NULL) {
|
||||
SU_DEBUG_3(("%s(%p): Error: no TLS context data for connected socket.\n",
|
||||
SU_DEBUG_3(("%s(%p): Error: no TLS context data for connected socket.\n",
|
||||
__func__, tlstp));
|
||||
tport_close(self);
|
||||
tport_set_secondary_timer(self);
|
||||
@ -746,7 +745,7 @@ int tls_connect(su_root_magic_t *magic, su_wait_t *w, tport_t *self)
|
||||
case SSL_ERROR_WANT_WRITE:
|
||||
/* OpenSSL is waiting for the peer to receive handshake data */
|
||||
self->tp_events = SU_WAIT_IN | SU_WAIT_ERR | SU_WAIT_HUP | SU_WAIT_OUT;
|
||||
su_root_eventmask(mr->mr_root, self->tp_index,
|
||||
su_root_eventmask(mr->mr_root, self->tp_index,
|
||||
self->tp_socket, self->tp_events);
|
||||
return 0;
|
||||
|
||||
@ -761,7 +760,7 @@ int tls_connect(su_root_magic_t *magic, su_wait_t *w, tport_t *self)
|
||||
self->tp_events = SU_WAIT_IN | SU_WAIT_ERR | SU_WAIT_HUP;
|
||||
|
||||
if ((su_wait_create(wait, self->tp_socket, self->tp_events) == -1) ||
|
||||
((self->tp_index = su_root_register(mr->mr_root, wait, tport_wakeup,
|
||||
((self->tp_index = su_root_register(mr->mr_root, wait, tport_wakeup,
|
||||
self, 0)) == -1)) {
|
||||
tport_close(self);
|
||||
tport_set_secondary_timer(self);
|
||||
@ -773,7 +772,7 @@ int tls_connect(su_root_magic_t *magic, su_wait_t *w, tport_t *self)
|
||||
self->tp_is_connected = 1;
|
||||
self->tp_verified = tls->verified;
|
||||
self->tp_subjects = tls->subject == NULL ? NULL :
|
||||
su_strlst_dup(self->tp_home, tls->subject);
|
||||
su_strlst_dup(self->tp_home, tls->subject);
|
||||
|
||||
if (tport_has_queued(self))
|
||||
tport_send_event(self);
|
||||
@ -788,7 +787,7 @@ int tls_connect(su_root_magic_t *magic, su_wait_t *w, tport_t *self)
|
||||
{
|
||||
char errbuf[64];
|
||||
ERR_error_string_n(status, errbuf, 64);
|
||||
SU_DEBUG_3(("%s(%p): TLS setup failed (%s)\n",
|
||||
SU_DEBUG_3(("%s(%p): TLS setup failed (%s)\n",
|
||||
__func__, self, errbuf));
|
||||
}
|
||||
break;
|
||||
@ -801,4 +800,3 @@ int tls_connect(su_root_magic_t *magic, su_wait_t *w, tport_t *self)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
* @author Tat Chan <Tat.Chan@nokia.com>
|
||||
* @author Kai Vehmanen <kai.vehmanen@nokia.com>
|
||||
* @author Martti Mela <Martti.Mela@nokia.com>
|
||||
* @author Jarod Neuner <janeuner@networkharbor.com>
|
||||
*
|
||||
* @date Split here: Fri Mar 24 08:45:49 EET 2006 ppessi
|
||||
* @date Originally Created: Thu Jul 20 12:54:32 2000 ppessi
|
||||
@ -554,7 +555,7 @@ int tport_tls_accept(tport_primary_t *pri, int events)
|
||||
/* Alloc a new transport object, then register socket events with it */
|
||||
if ((self = tport_alloc_secondary(pri, s, 1, &reason)) == NULL) {
|
||||
SU_DEBUG_3(("%s(%p): incoming secondary on "TPN_FORMAT
|
||||
" failed. reason = %s\n", __func__, pri,
|
||||
" failed. reason = %s\n", __func__, pri,
|
||||
TPN_ARGS(pri->pri_primary->tp_name), reason));
|
||||
return 0;
|
||||
}
|
||||
@ -622,12 +623,12 @@ tport_t *tport_tls_connect(tport_primary_t *pri,
|
||||
socklen_t susalen = sizeof(susa);
|
||||
|
||||
if (getsockname(server_socket, &susa.su_sa, &susalen) < 0) {
|
||||
SU_DEBUG_3(("%s(%p): getsockname(): %s\n",
|
||||
SU_DEBUG_3(("%s(%p): getsockname(): %s\n",
|
||||
__func__, (void *)self, su_strerror(su_errno())));
|
||||
} else {
|
||||
susa.su_port = 0;
|
||||
if (bind(s, &susa.su_sa, susalen) < 0) {
|
||||
SU_DEBUG_3(("%s(%p): bind(local-ip): %s\n",
|
||||
SU_DEBUG_3(("%s(%p): bind(local-ip): %s\n",
|
||||
__func__, (void *)self, su_strerror(su_errno())));
|
||||
}
|
||||
}
|
||||
@ -651,7 +652,7 @@ tport_t *tport_tls_connect(tport_primary_t *pri,
|
||||
|
||||
SU_DEBUG_5(("%s(%p): connecting to " TPN_FORMAT "\n",
|
||||
__func__, (void *)self, TPN_ARGS(self->tp_name)));
|
||||
|
||||
|
||||
tport_set_secondary_timer(self);
|
||||
|
||||
return self;
|
||||
@ -660,11 +661,10 @@ sys_error:
|
||||
err = errno;
|
||||
if (SU_LOG_LEVEL >= errlevel)
|
||||
su_llog(tport_log, errlevel, "%s(%p): %s (pf=%d %s/%s): %s\n",
|
||||
__func__, (void *)pri, what, ai->ai_family, tpn->tpn_proto,
|
||||
__func__, (void *)pri, what, ai->ai_family, tpn->tpn_proto,
|
||||
tport_hostport(buf, sizeof(buf), (void *)ai->ai_addr, 2),
|
||||
su_strerror(err));
|
||||
tport_zap_secondary(self);
|
||||
su_seterrno(err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user