Commit 55700cb0 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

- We no longer support setting the CURLOPT_URL option from inside a callback

  such as the CURLOPT_SSL_CTX_FUNCTION one treat that as if it was a Location:
  following. The patch that introduced this feature was done for 7.11.0, but
  this code and functionality has been broken since about 7.15.4 (March 2006)
  with the introduction of non-blocking OpenSSL "connects".

  It was a hack to begin with and since it doesn't work and hasn't worked
  correctly for a long time and nobody has even noticed, I consider it a very
  suitable subject for plain removal. And so it was done.
parent f9a60620
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -6,6 +6,17 @@


                                  Changelog
                                  Changelog


Daniel S (20 Feb 2008)
- We no longer support setting the CURLOPT_URL option from inside a callback
  such as the CURLOPT_SSL_CTX_FUNCTION one treat that as if it was a Location:
  following. The patch that introduced this feature was done for 7.11.0, but
  this code and functionality has been broken since about 7.15.4 (March 2006)
  with the introduction of non-blocking OpenSSL "connects".

  It was a hack to begin with and since it doesn't work and hasn't worked
  correctly for a long time and nobody has even noticed, I consider it a very
  suitable subject for plain removal. And so it was done.

Daniel Fandrich (19 Feb 2007)
Daniel Fandrich (19 Feb 2007)
- Added test309 to test HTTP redirect to HTTPS URL
- Added test309 to test HTTP redirect to HTTPS URL


+4 −1
Original line number Original line Diff line number Diff line
@@ -13,6 +13,8 @@ This release includes the following changes:
 o added support for HttpOnly cookies
 o added support for HttpOnly cookies
 o 'make ca-bundle' downloads and generates an updated ca bundle file
 o 'make ca-bundle' downloads and generates an updated ca bundle file
 o we no longer distribute or install a ca cert bundle
 o we no longer distribute or install a ca cert bundle
 o SSLv2 is now disabled by default for SSL operations
 o the test509-style setting URL in callback is officially no longer supported


This release includes the following bugfixes:
This release includes the following bugfixes:


@@ -42,6 +44,7 @@ This release would not have looked like this without help, code, reports and
advice from friends like these:
advice from friends like these:


 Michal Marek, Dmitry Kurochkin, Niklas Angebrand, Günter Knauf, Yang Tse,
 Michal Marek, Dmitry Kurochkin, Niklas Angebrand, Günter Knauf, Yang Tse,
 Dan Fandrich, Mike Hommey, Pooyan McSporran, Jerome Muffat-Meridol
 Dan Fandrich, Mike Hommey, Pooyan McSporran, Jerome Muffat-Meridol,
 Kaspar Brand


        Thanks! (and sorry if I forgot to mention someone)
        Thanks! (and sorry if I forgot to mention someone)
+3 −1
Original line number Original line Diff line number Diff line
@@ -230,7 +230,9 @@ Curl_gtls_connect(struct connectdata *conn,
  void *ssl_sessionid;
  void *ssl_sessionid;
  size_t ssl_idsize;
  size_t ssl_idsize;


  if(!gtls_inited) _Curl_gtls_init();
  if(!gtls_inited)
    _Curl_gtls_init();

  /* GnuTLS only supports TLSv1 (and SSLv3?) */
  /* GnuTLS only supports TLSv1 (and SSLv3?) */
  if(data->set.ssl.version == CURL_SSLVERSION_SSLv2) {
  if(data->set.ssl.version == CURL_SSLVERSION_SSLv2) {
    failf(data, "GnuTLS does not support SSLv2");
    failf(data, "GnuTLS does not support SSLv2");
+7 −38
Original line number Original line Diff line number Diff line
@@ -860,12 +860,14 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
  CURLMcode result = CURLM_OK;
  CURLMcode result = CURLM_OK;
  struct SingleRequest *k;
  struct SingleRequest *k;


  do {
    bool disconnect_conn = FALSE;

  if(!GOOD_EASY_HANDLE(easy->easy_handle))
  if(!GOOD_EASY_HANDLE(easy->easy_handle))
    return CURLM_BAD_EASY_HANDLE;
    return CURLM_BAD_EASY_HANDLE;


  do {
    /* this is a do-while loop just to allow a break to skip to the end
       of it */
    bool disconnect_conn = FALSE;

    /* Handle the case when the pipe breaks, i.e., the connection
    /* Handle the case when the pipe breaks, i.e., the connection
       we're using gets cleaned up and we're left with nothing. */
       we're using gets cleaned up and we're left with nothing. */
    if(easy->easy_handle->state.pipe_broke) {
    if(easy->easy_handle->state.pipe_broke) {
@@ -885,40 +887,9 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
    }
    }


    if(easy->state > CURLM_STATE_CONNECT &&
    if(easy->state > CURLM_STATE_CONNECT &&
        easy->state < CURLM_STATE_COMPLETED) {
       easy->state < CURLM_STATE_COMPLETED)
      /* Make sure we set the connection's current owner */
      /* Make sure we set the connection's current owner */
      easy->easy_conn->data = easy->easy_handle;
      easy->easy_conn->data = easy->easy_handle;
    }

    if(CURLM_STATE_WAITCONNECT <= easy->state &&
        easy->state <= CURLM_STATE_DO &&
        easy->easy_handle->change.url_changed) {
      char *gotourl;
      Curl_posttransfer(easy->easy_handle);

      easy->result = Curl_done(&easy->easy_conn, CURLE_OK, FALSE);
      /* We make sure that the pipe broken flag is reset
         because in this case, it isn't an actual break */
      easy->easy_handle->state.pipe_broke = FALSE;
      if(CURLE_OK == easy->result) {
        gotourl = strdup(easy->easy_handle->change.url);
        if(gotourl) {
          easy->easy_handle->change.url_changed = FALSE;
          easy->result = Curl_follow(easy->easy_handle, gotourl, FALSE);
          if(CURLE_OK == easy->result)
            multistate(easy, CURLM_STATE_CONNECT);
          else
            free(gotourl);
        }
        else {
          easy->result = CURLE_OUT_OF_MEMORY;
          multistate(easy, CURLM_STATE_COMPLETED);
          break;
        }
      }
    }

    easy->easy_handle->change.url_changed = FALSE;


    switch(easy->state) {
    switch(easy->state) {
    case CURLM_STATE_INIT:
    case CURLM_STATE_INIT:
@@ -1403,9 +1374,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
        multistate(easy, CURLM_STATE_COMPLETED);
        multistate(easy, CURLM_STATE_COMPLETED);
      }
      }
    }
    }

  } while(0);
  } while(easy->easy_handle->change.url_changed);

  if((CURLM_STATE_COMPLETED == easy->state) && !easy->msg) {
  if((CURLM_STATE_COMPLETED == easy->state) && !easy->msg) {
    if(easy->easy_handle->dns.hostcachetype == HCACHE_MULTI) {
    if(easy->easy_handle->dns.hostcachetype == HCACHE_MULTI) {
      /* clear out the usage of the shared DNS cache */
      /* clear out the usage of the shared DNS cache */
+16 −36
Original line number Original line Diff line number Diff line
@@ -2260,14 +2260,11 @@ connect_host(struct SessionHandle *data,
             struct connectdata **conn)
             struct connectdata **conn)
{
{
  CURLcode res = CURLE_OK;
  CURLcode res = CURLE_OK;
  int urlchanged = FALSE;


  do {
  bool async;
  bool async;
  bool protocol_done=TRUE; /* will be TRUE always since this is only used
  bool protocol_done=TRUE; /* will be TRUE always since this is only used
                                within the easy interface */
                                within the easy interface */
  Curl_pgrsTime(data, TIMER_STARTSINGLE);
  Curl_pgrsTime(data, TIMER_STARTSINGLE);
    data->change.url_changed = FALSE;
  res = Curl_connect(data, conn, &async, &protocol_done);
  res = Curl_connect(data, conn, &async, &protocol_done);


  if((CURLE_OK == res) && async) {
  if((CURLE_OK == res) && async) {
@@ -2281,23 +2278,6 @@ connect_host(struct SessionHandle *data,
      /* if we can't resolve, we kill this "connection" now */
      /* if we can't resolve, we kill this "connection" now */
      (void)Curl_disconnect(*conn);
      (void)Curl_disconnect(*conn);
  }
  }
    if(res)
      break;

    /* If a callback (or something) has altered the URL we should use within
       the Curl_connect(), we detect it here and act as if we are redirected
       to the new URL */
    urlchanged = data->change.url_changed;
    if((CURLE_OK == res) && urlchanged) {
      res = Curl_done(conn, res, FALSE);
      if(CURLE_OK == res) {
        char *gotourl = strdup(data->change.url);
        res = Curl_follow(data, gotourl, FALSE);
        if(res)
          free(gotourl);
      }
    }
  } while(urlchanged && res == CURLE_OK);


  return res;
  return res;
}
}
Loading