You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2016/02/14 18:53:23 UTC
[1/2] trafficserver git commit: TS-4202: missing define
_HTTP_CONNECTION_COUNT_H_
Repository: trafficserver
Updated Branches:
refs/heads/master 4d14cea66 -> 3b19ff798
TS-4202: missing define _HTTP_CONNECTION_COUNT_H_
This closes #477.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8edc393a
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8edc393a
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8edc393a
Branch: refs/heads/master
Commit: 8edc393a77895656bcfb9ae3c1f555ff32751d07
Parents: 4d14cea
Author: Oknet <xu...@gmail.com>
Authored: Sun Feb 14 20:36:28 2016 +0800
Committer: James Peach <jp...@apache.org>
Committed: Sun Feb 14 09:23:26 2016 -0800
----------------------------------------------------------------------
proxy/http/HttpConnectionCount.h | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8edc393a/proxy/http/HttpConnectionCount.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConnectionCount.h b/proxy/http/HttpConnectionCount.h
index 25783aa..af4d7f6 100644
--- a/proxy/http/HttpConnectionCount.h
+++ b/proxy/http/HttpConnectionCount.h
@@ -28,6 +28,7 @@
#include "ts/Map.h"
#ifndef _HTTP_CONNECTION_COUNT_H_
+#define _HTTP_CONNECTION_COUNT_H_
/**
* Singleton class to keep track of the number of connections per host
[2/2] trafficserver git commit: TS-4203: Multiple PD init/alloc in
PollCont
Posted by jp...@apache.org.
TS-4203: Multiple PD init/alloc in PollCont
The constructor for PollDescriptor calls init() to create a `epoll_fd'.
Calling init() again does not close epoll_fd if it is already opened.
Make init() private and just depend on the constructor to do the
right thing.
This closes #478.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/3b19ff79
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/3b19ff79
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/3b19ff79
Branch: refs/heads/master
Commit: 3b19ff79846502718b9710e9e5cf596677568807
Parents: 8edc393
Author: Oknet <xu...@gmail.com>
Authored: Sun Feb 14 20:53:47 2016 +0800
Committer: James Peach <jp...@apache.org>
Committed: Sun Feb 14 09:52:54 2016 -0800
----------------------------------------------------------------------
iocore/net/P_UnixPollDescriptor.h | 8 +++++---
iocore/net/UnixNet.cc | 6 ++----
iocore/net/UnixUDPNet.cc | 3 +--
3 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3b19ff79/iocore/net/P_UnixPollDescriptor.h
----------------------------------------------------------------------
diff --git a/iocore/net/P_UnixPollDescriptor.h b/iocore/net/P_UnixPollDescriptor.h
index 8a1c496..ddd5147 100644
--- a/iocore/net/P_UnixPollDescriptor.h
+++ b/iocore/net/P_UnixPollDescriptor.h
@@ -60,6 +60,8 @@ struct PollDescriptor {
int port_fd;
#endif
+ PollDescriptor() { init(); }
+
#if TS_USE_EPOLL
#define get_ev_port(a) ((a)->epoll_fd)
#define get_ev_events(a, x) ((a)->ePoll_Triggered_Events[(x)].events)
@@ -115,7 +117,9 @@ struct PollDescriptor {
return 0;
#endif
}
- PollDescriptor *
+
+private:
+ void
init()
{
result = 0;
@@ -133,9 +137,7 @@ struct PollDescriptor {
port_fd = port_create();
memset(Port_Triggered_Events, 0, sizeof(Port_Triggered_Events));
#endif
- return this;
}
- PollDescriptor() { init(); }
};
#endif
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3b19ff79/iocore/net/UnixNet.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc
index aec2703..28185f7 100644
--- a/iocore/net/UnixNet.cc
+++ b/iocore/net/UnixNet.cc
@@ -140,16 +140,14 @@ update_cop_config(const char *name, RecDataT data_type ATS_UNUSED, RecData data,
PollCont::PollCont(ProxyMutex *m, int pt) : Continuation(m), net_handler(NULL), nextPollDescriptor(NULL), poll_timeout(pt)
{
- pollDescriptor = new PollDescriptor;
- pollDescriptor->init();
+ pollDescriptor = new PollDescriptor();
SET_HANDLER(&PollCont::pollEvent);
}
PollCont::PollCont(ProxyMutex *m, NetHandler *nh, int pt)
: Continuation(m), net_handler(nh), nextPollDescriptor(NULL), poll_timeout(pt)
{
- pollDescriptor = new PollDescriptor;
- pollDescriptor->init();
+ pollDescriptor = new PollDescriptor();
SET_HANDLER(&PollCont::pollEvent);
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3b19ff79/iocore/net/UnixUDPNet.cc
----------------------------------------------------------------------
diff --git a/iocore/net/UnixUDPNet.cc b/iocore/net/UnixUDPNet.cc
index 6530167..b4dd8c1 100644
--- a/iocore/net/UnixUDPNet.cc
+++ b/iocore/net/UnixUDPNet.cc
@@ -301,8 +301,7 @@ UDPReadContinuation::setupPollDescriptor()
EThread *et = (EThread *)this_thread();
PollCont *pc = get_PollCont(et);
if (pc->nextPollDescriptor == NULL) {
- pc->nextPollDescriptor = new PollDescriptor;
- pc->nextPollDescriptor->init();
+ pc->nextPollDescriptor = new PollDescriptor();
}
pfd = pc->nextPollDescriptor->alloc();
pfd->fd = fd;