Commit c15b536d authored by Mark Andrews's avatar Mark Andrews
Browse files

3543. [bug] Update socket stucture before attaching to socket

                        manager after accert. [RT #33084]
parent b1fb5abb
3543. [bug] Update socket stucture before attaching to socket
manager after accert. [RT #33084]
3542. [placeholder]
3541. [bug] The parts if libdns was not being properly initialized
......
......@@ -3468,14 +3468,6 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
if (fd != -1) {
int lockid = FDLOCK_ID(fd);
LOCK(&manager->fdlock[lockid]);
manager->fds[fd] = NEWCONNSOCK(dev);
manager->fdstate[fd] = MANAGED;
UNLOCK(&manager->fdlock[lockid]);
LOCK(&manager->lock);
ISC_LIST_APPEND(manager->socklist, NEWCONNSOCK(dev), link);
NEWCONNSOCK(dev)->fd = fd;
NEWCONNSOCK(dev)->bound = 1;
NEWCONNSOCK(dev)->connected = 1;
......@@ -3496,6 +3488,13 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
*/
dev->address = NEWCONNSOCK(dev)->peer_address;
LOCK(&manager->fdlock[lockid]);
manager->fds[fd] = NEWCONNSOCK(dev);
manager->fdstate[fd] = MANAGED;
UNLOCK(&manager->fdlock[lockid]);
LOCK(&manager->lock);
#ifdef USE_SELECT
if (manager->maxfd < fd)
manager->maxfd = fd;
......@@ -3506,6 +3505,8 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
"accepted connection, new socket %p",
dev->newsocket);
ISC_LIST_APPEND(manager->socklist, NEWCONNSOCK(dev), link);
UNLOCK(&manager->lock);
inc_stats(manager->stats, sock->statsindex[STATID_ACCEPT]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment