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

manager after accert. [RT #33084]
(cherry picked from commit a8572209bc)
This commit is contained in:
Mark Andrews 2013-04-03 17:42:42 +11:00
parent dde95c2023
commit be587dff9b
2 changed files with 12 additions and 8 deletions

View file

@ -1,3 +1,6 @@
3543. [bug] Update socket stucture before attaching to socket
manager after accert. [RT #33084]
3541. [bug] The parts if libdns was not being properly initialized
in when built in libexport mode. [RT #33028]

View file

@ -3215,14 +3215,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;
@ -3237,6 +3229,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;
@ -3247,6 +3246,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]);