BOOL cg_http_serverlist_stop(CgHttpServerList *httpServerList) { CgHttpServer *httpServer; cg_log_debug_l4("Entering...\n"); for (httpServer = cg_http_serverlist_gets(httpServerList); httpServer != NULL; httpServer = cg_http_server_next(httpServer)) cg_http_server_stop(httpServer); cg_log_debug_l4("Leaving...\n"); return TRUE; }
void cg_http_server_delete(CgHttpServer *httpServer) { cg_log_debug_l4("Entering...\n"); cg_http_server_stop(httpServer); cg_http_server_close(httpServer); if (httpServer->mutex) cg_mutex_delete(httpServer->mutex); cg_list_remove((CgList *)httpServer); free(httpServer); cg_log_debug_l4("Leaving...\n"); }
BOOL cg_http_server_close(CgHttpServer *httpServer) { cg_log_debug_l4("Entering...\n"); cg_http_server_stop(httpServer); if (httpServer->sock != NULL) { cg_socket_close(httpServer->sock); cg_socket_delete(httpServer->sock); httpServer->sock = NULL; } cg_log_debug_l4("Leaving...\n"); return TRUE; }
BOOL cg_bittorrent_client_stop(CgBittorrentClient *cbc) { if (cbc->httpServer) cg_http_server_stop(cbc->httpServer); if (cbc->acceptThread) { cg_thread_stop(cbc->acceptThread); cg_thread_delete(cbc->acceptThread); cbc->acceptThread = NULL; } if (cbc->clientThreads) { cg_threadlist_stop(cbc->clientThreads); cg_threadlist_delete(cbc->clientThreads); cbc->clientThreads = NULL; } return TRUE; }