void am_url_validator_shutdown() { am_close_timer_event(validator_timer); AM_MUTEX_DESTROY(&table_mutex); delete_url_validation_table(&table); table = NULL; validator_timer = NULL; }
int am_net_close(am_net_t *n) { if (n == NULL) { return AM_EINVAL; } #ifdef _WIN32 WaitForSingleObject(n->pw, INFINITE); CloseHandle(n->pw); DeleteCriticalSection(&n->lk); #else pthread_join(n->pw, NULL); pthread_mutex_destroy(&n->lk); #endif /* close ssl/socket */ am_net_diconnect(n); /* shut down connected/disconnected events */ close_event(n->ce); close_exit_event(n->de); /* shut down response timeout handler */ am_close_timer_event(n->tm); n->tm = NULL; if (n->ra != NULL) { freeaddrinfo(n->ra); } n->ra = NULL; AM_FREE(n->hs, n->hp, n->req_headers); n->hs = NULL; n->hp = NULL; n->req_headers = NULL; return AM_SUCCESS; }