You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2018/01/19 07:33:37 UTC
[trafficserver] branch quic-latest updated: Use
UDPNetProcessor::CreateUDPSocket()
This is an automated email from the ASF dual-hosted git repository.
masaori pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/quic-latest by this push:
new e961972 Use UDPNetProcessor::CreateUDPSocket()
e961972 is described below
commit e9619720ce62bf20ed3c4ce3d271626a61fd2828
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Fri Jan 19 16:33:24 2018 +0900
Use UDPNetProcessor::CreateUDPSocket()
---
iocore/net/QUICNetProcessor.cc | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/iocore/net/QUICNetProcessor.cc b/iocore/net/QUICNetProcessor.cc
index ff6bcf2..2c10942 100644
--- a/iocore/net/QUICNetProcessor.cc
+++ b/iocore/net/QUICNetProcessor.cc
@@ -118,20 +118,15 @@ QUICNetProcessor::connect_re(Continuation *cont, sockaddr const *remote_addr, Ne
EThread *t = cont->mutex->thread_holding;
ink_assert(t);
- sockaddr_in local_addr;
- local_addr.sin_family = remote_addr->sa_family;
- local_addr.sin_addr.s_addr = htonl(INADDR_ANY);
- local_addr.sin_port = 0;
-
- // FIXME: set buffer size
- int fd = socketManager.socket(local_addr.sin_family, SOCK_DGRAM, 0);
- if (fd < 0) {
- return ACTION_IO_ERROR;
- }
-
- int res = fcntl(fd, F_SETFL, O_NONBLOCK);
- if (res < 0) {
- return ACTION_IO_ERROR;
+ sockaddr local_addr;
+ int local_addr_len;
+ local_addr.sa_family = remote_addr->sa_family;
+
+ int fd;
+ Action *status;
+ bool result = udpNet.CreateUDPSocket(&fd, remote_addr, &local_addr, &local_addr_len, &status, 1048576, 1048576);
+ if (!result) {
+ return status;
}
// Setup UDPConnection
@@ -145,8 +140,8 @@ QUICNetProcessor::connect_re(Continuation *cont, sockaddr const *remote_addr, Ne
PollCont *pc = get_UDPPollCont(con->ethread);
PollDescriptor *pd = pc->pollDescriptor;
- errno = 0;
- res = con->ep.start(pd, con, EVENTIO_READ);
+ errno = 0;
+ int res = con->ep.start(pd, con, EVENTIO_READ);
if (res < 0) {
Debug("udpnet", "Error: %s (%d)", strerror(errno), errno);
}
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].