/* Used by the connect code to tell the multi_socket code that one of the sockets we were using is about to be closed. This function will then remove it from the sockethash for this handle to make the multi_socket API behave properly, especially for the case when libcurl will create another socket again and it gets the same file descriptor number.  */
void Curl_multi_closed(struct Curl_easy *data, curl_socket_t s)
/* Used by the connect code to tell the multi_socket code that one of the sockets we were using is about to be closed. This function will then remove it from the sockethash for this handle to make the multi_socket API behave properly, especially for the case when libcurl will create another socket again and it gets the same file descriptor number.  */
void Curl_multi_closed(struct Curl_easy *data, curl_socket_t s)
{
  if(data) {
    struct Curl_multi *multi = data->multi;
    if(multi) {
      struct Curl_sh_entry *entry = sh_getentry(&multi->sockhash, s);
      if(entry) {
        if(multi->socket_cb)
          multi->socket_cb(data, s, CURL_POLL_REMOVE,
                           multi->socket_userp,
                           entry->socketp);
        sh_delentry(&multi->sockhash, s);
      }
    }
  }
}