~ubuntu-branches/ubuntu/vivid/libdap/vivid

« back to all changes in this revision

Viewing changes to HTTPConnect.cc

  • Committer: Package Import Robot
  • Author(s): Alastair McKinstry
  • Date: 2013-10-17 22:12:11 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20131017221211-re1r37k4d6wrtmeq
Tags: 3.12.0-1
* New upstream release.
  - No longer need curl-types-remove.patch 
* Add debian/watch file.
* Fix typo in hardening flags; Change  to =all,-pie ; 
  Use DEB_LDFLAGS_MAINT_APPEND. Closes: #697387.
* Enable parallel build. Closes: #723938.
* Depend on libcurl4-gnutls-dev | libcurl-dev. Closes: #722701.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
//
20
20
// You should have received a copy of the GNU Lesser General Public
21
21
// License along with this library; if not, write to the Free Software
22
 
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
22
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23
23
//
24
24
// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
25
25
 
26
26
 
27
27
#include "config.h"
28
28
 
29
 
static char rcsid[] not_used =
30
 
    { "$Id: HTTPConnect.cc 24380 2011-03-28 21:47:15Z jimg $"
31
 
    };
32
 
 
33
29
#ifdef HAVE_UNISTD_H
34
30
#include <unistd.h>
35
31
#endif
49
45
#include <cstdlib>
50
46
#include <cstring>
51
47
 
52
 
// #define DODS_DEBUG
53
48
//#define DODS_DEBUG2
54
49
//#define HTTP_TRACE
55
50
//#define DODS_DEBUG
448
443
    // value/result parameter to get the raw response header information .
449
444
    curl_easy_setopt(d_curl, CURLOPT_WRITEHEADER, resp_hdrs);
450
445
 
 
446
    // This is the call that causes curl to go and get the remote resource and "write it down"
 
447
    // utilizing the configuration state that has been previously conditioned by various perturbations
 
448
    // of calls to curl_easy_setopt().
451
449
    CURLcode res = curl_easy_perform(d_curl);
452
450
 
453
451
    // Free the header list and null the value in d_curl.
525
523
 
526
524
    // HTTPCache::instance returns a valid ptr or 0.
527
525
    if (d_rcr->get_use_cache())
528
 
        d_http_cache = HTTPCache::instance(d_rcr->get_dods_cache_root(),
529
 
                                           true);
 
526
        d_http_cache = HTTPCache::instance(d_rcr->get_dods_cache_root(),true);
530
527
    else
531
528
        d_http_cache = 0;
532
529
 
887
884
    try {
888
885
        status = read_url(url, stream, resp_hdrs); // Throws Error.
889
886
        if (status >= 400) {
890
 
                delete resp_hdrs;
 
887
                // delete resp_hdrs; resp_hdrs = 0;
891
888
            string msg = "Error while reading the URL: ";
892
889
            msg += url;
893
890
            msg += ".\nThe OPeNDAP server returned the following message:\n";