diff --git a/ChangeLog b/ChangeLog index c81e6c9..c686c21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ Version 1.8.0 ******************************************************************************* +2008-05-31 Marcelo Jimenez + * Charles Nepveu's suggestion of not allocating a thread for + MiniServer when it is not compiled. + 2008-05-26 Marcelo Jimenez * SF Bug Tracker [ 1903069 ] Subs (not services) not marked 'active' diff --git a/upnp/src/api/upnpapi.c b/upnp/src/api/upnpapi.c index 41d4b69..518ffec 100644 --- a/upnp/src/api/upnpapi.c +++ b/upnp/src/api/upnpapi.c @@ -113,7 +113,9 @@ TimerThread gTimerThread; ThreadPool gSendThreadPool; ThreadPool gRecvThreadPool; -ThreadPool gMiniServerThreadPool; +#ifdef INTERNAL_WEB_SERVER + ThreadPool gMiniServerThreadPool; +#endif // Flag to indicate the state of web server WebServerState bWebServerState = WEB_SERVER_DISABLED; @@ -302,7 +304,9 @@ int UpnpFinish() } PrintThreadPoolStats(&gSendThreadPool, __FILE__, __LINE__, "Send Thread Pool"); PrintThreadPoolStats(&gRecvThreadPool, __FILE__, __LINE__, "Recv Thread Pool"); +#ifdef INTERNAL_WEB_SERVER PrintThreadPoolStats(&gMiniServerThreadPool, __FILE__, __LINE__, "MiniServer Thread Pool"); +#endif #ifdef INCLUDE_DEVICE_APIS if (GetDeviceHandleInfo(AF_INET, &device_handle, &temp) == HND_DEVICE ) { @@ -326,13 +330,14 @@ int UpnpFinish() web_server_destroy(); #endif +#ifdef INTERNAL_WEB_SERVER ThreadPoolShutdown(&gMiniServerThreadPool); - ThreadPoolShutdown(&gRecvThreadPool); - ThreadPoolShutdown(&gSendThreadPool); - - PrintThreadPoolStats(&gSendThreadPool, __FILE__, __LINE__, "Send Thread Pool"); - PrintThreadPoolStats(&gRecvThreadPool, __FILE__, __LINE__, "Recv Thread Pool"); PrintThreadPoolStats(&gMiniServerThreadPool, __FILE__, __LINE__, "MiniServer Thread Pool"); +#endif + ThreadPoolShutdown(&gRecvThreadPool); + PrintThreadPoolStats(&gSendThreadPool, __FILE__, __LINE__, "Send Thread Pool"); + ThreadPoolShutdown(&gSendThreadPool); + PrintThreadPoolStats(&gRecvThreadPool, __FILE__, __LINE__, "Recv Thread Pool"); #ifdef INCLUDE_CLIENT_APIS ithread_mutex_destroy(&GlobalClientSubscribeMutex); @@ -3396,10 +3401,12 @@ int UpnpInitThreadPools() goto ExitFunction; } +#ifdef INTERNAL_WEB_SERVER if (ThreadPoolInit(&gMiniServerThreadPool, &attr) != UPNP_E_SUCCESS) { ret = UPNP_E_INIT_FAILED; goto ExitFunction; } +#endif ExitFunction: if (ret != UPNP_E_SUCCESS) {