/* Returns TRUE if the connection was dead and extracted.  */
static bool extract_if_dead(struct connectdata *conn, struct Curl_easy *data)
/* Returns TRUE if the connection was dead and extracted.  */
static bool extract_if_dead(struct connectdata *conn, struct Curl_easy *data)
{
  if(!CONN_INUSE(conn) && !conn->data) {
    bool dead;
    if(conn->handler->connection_check) {
      unsigned int state;
      struct Curl_easy *olddata = conn->data;
      conn->data = data;
      state = conn->handler->connection_check(conn, CONNCHECK_ISDEAD);
      conn->data = olddata;
      dead = (state & CONNRESULT_DEAD);
    }
    else {
      dead = SocketIsDead(conn->sock[FIRSTSOCKET]);
    }
    if(dead) {
      infof(data, "Connection %ld seems to be dead!\n", conn->connection_id);
      Curl_conncache_remove_conn(data, conn, FALSE);
      return TRUE;
    }
  }
  return FALSE;
}