58 size_t totalsize = nitems *
size;
61 if(bytes_to_send > totalsize) {
62 bytes_to_send = totalsize;
65 memset(ptr,
'a', bytes_to_send);
81 size_t totalsize = nmemb *
size;
100 long expected_connections)
103 long connections = 0;
107 fprintf(stderr,
"curl_easy_perform() failed\n");
113 fprintf(stderr,
"curl_easy_getinfo() failed\n");
117 fprintf(stderr,
"%s: expected: %ld connections; actual: %ld connections\n",
118 description, expected_connections, connections);
120 if(connections != expected_connections) {
135 fprintf(stderr,
"curl_global_init() failed\n");
141 fprintf(stderr,
"curl_easy_init() failed\n");
159 "First request without CURLOPT_KEEP_SENDING_ON_ERROR", 1);
167 "Second request without CURLOPT_KEEP_SENDING_ON_ERROR", 1);
172 test_setopt(curl, CURLOPT_KEEP_SENDING_ON_ERROR, 1L);
177 "First request with CURLOPT_KEEP_SENDING_ON_ERROR", 1);
185 "Second request with CURLOPT_KEEP_SENDING_ON_ERROR", 0);
#define test_setopt(A, B, C)
UNITTEST_START char * ptr
CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask)
static size_t read_callback(void *ptr, size_t size, size_t nitems, void *userdata)
#define TEST_ERR_MAJOR_BAD
#define curl_easy_getinfo(handle, info, arg)
CURL_EXTERN CURL * curl_easy_init(void)
static void reset_data(struct cb_data *data, CURL *curl)
CURL_EXTERN void curl_easy_cleanup(CURL *curl)
CURL_TYPEOF_CURL_OFF_T curl_off_t
static size_t write_callback(char *ptr, size_t size, size_t nmemb, void *userdata)
CURL_EXTERN CURLcode curl_global_init(long flags)
curl_global_init() globally initializes curl given a bitwise set of the different features of what to...
#define CURL_READFUNC_PAUSE
CURL_EXTERN void curl_global_cleanup(void)
curl_global_cleanup() globally cleanups curl, uses the value of "init_flags" to determine what needs ...
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl)
static int perform_and_check_connections(CURL *curl, const char *description, long expected_connections)