~holger-seelig/titania/3.0

« back to all changes in this revision

Viewing changes to libtitania-stream/Titania/Stream/SocketStreamBuf.cpp

  • Committer: Holger Seelig
  • Date: 2013-08-05 19:51:24 UTC
  • Revision ID: holger.seelig@yahoo.de-20130805195124-weg56pajdi69mt1j
Test implementation of parallel load of images.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "SocketStreamBuf.h"
30
30
 
31
31
#include <cstring>
32
 
#include <curl/curl.h>
33
32
#include <istream>
34
33
 
35
34
#include <Titania/LOG.h>
55
54
        setg (buffer + bufferSize,  // beginning of putback area
56
55
              buffer + bufferSize,  // read position
57
56
              buffer + bufferSize); // end position
 
57
 
 
58
        //curl_global_init (CURL_GLOBAL_ALL); // Not thread save
58
59
}
59
60
 
60
61
socketstreambuf*
82
83
        // Connect.
83
84
 
84
85
        curl_easy_setopt (curl, CURLOPT_URL,               url () .root () .str () .c_str ());
85
 
        curl_easy_setopt (curl, CURLOPT_CONNECT_ONLY,      1L);
 
86
        curl_easy_setopt (curl, CURLOPT_CONNECT_ONLY,      true);
86
87
        curl_easy_setopt (curl, CURLOPT_CONNECTTIMEOUT_MS, timeout ());
87
88
        curl_easy_setopt (curl, CURLOPT_TIMEOUT_MS,        timeout ());
88
89
        curl_easy_setopt (curl, CURLOPT_ACCEPTTIMEOUT_MS,  timeout ());
89
 
 
 
90
        curl_easy_setopt (curl, CURLOPT_NOSIGNAL,          true);
 
91
 
90
92
        retcode = curl_easy_perform (curl);
91
93
 
92
94
        if (retcode not_eq CURLE_OK)