X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fyaz-pdu-assoc-thread.cpp;h=e13297ebc48a06ab33ba37655daeaf50b01f20a0;hb=bed85d2160500f57db63f4ab9d5533e0225cce15;hp=e48c0512a0f70e660518c392fa36c8a7eb9f4310;hpb=0cc824e02bc2c69986bec8c9dd9ff53f07a0cd3d;p=yazpp-moved-to-github.git diff --git a/src/yaz-pdu-assoc-thread.cpp b/src/yaz-pdu-assoc-thread.cpp index e48c051..e13297e 100644 --- a/src/yaz-pdu-assoc-thread.cpp +++ b/src/yaz-pdu-assoc-thread.cpp @@ -1,10 +1,11 @@ -/* - * Copyright (c) 1998-2004, Index Data. +/* This file is part of the yazpp toolkit. + * Copyright (C) 1998-2012 Index Data and Mike Taylor * See the file LICENSE for details. - * - * $Id: yaz-pdu-assoc-thread.cpp,v 1.14 2006-03-29 13:14:17 adam Exp $ */ +#if HAVE_CONFIG_H +#include +#endif #ifdef WIN32 #define USE_THREADS 1 #endif @@ -82,6 +83,14 @@ void PDU_AssocThread::childNotify(COMSTACK cs) /// Clone PDU Observer new_observable->m_PDU_Observer = m_PDU_Observer->sessionNotify(new_observable, cs_fileno(cs)); + + if (!new_observable->m_PDU_Observer) + { + new_observable->shutdown(); + delete new_observable; + delete socket_observable; + return; + } worker *w = new worker; w->m_assoc = new_observable; @@ -109,6 +118,7 @@ void PDU_AssocThread::childNotify(COMSTACK cs) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab