/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "safe-memset.h"
#include "ioloop.h"
#include "istream.h"
#include "write-full.h"
#include "http-url.h"
#include "http-client.h"
#include "dns-lookup.h"
#include "iostream-ssl.h"
#ifdef HAVE_OPENSSL
#include "iostream-openssl.h"
#endif
#include <fcntl.h>
#include <unistd.h>
struct http_test_request {
bool write_output;
};
{
const unsigned char *data;
int ret;
/* read payload */
if (req->write_output)
i_error("REQUEST PAYLOAD WRITE ERROR: %m");
}
if (ret == 0) {
i_info("DEBUG: REQUEST: NEED MORE DATA");
/* we will be called again for this request */
} else {
i_error("REQUEST PAYLOAD READ ERROR: %s",
} else
i_info("DEBUG: REQUEST: Finished");
}
}
static void
struct http_test_request *req)
{
/* payload (if any) is skipped implicitly */
return;
}
return;
}
i_info("DEBUG: REQUEST: Got payload");
}
{
// JigSAW is useful for testing: http://jigsaw.w3.org/HTTP/
"GET", "pigeonhole.dovecot.org", "/",
"GET", "jigsaw.w3.org", "/HTTP/300/301.html",
"GET", "jigsaw.w3.org", "/HTTP/300/307.html",
"GET", "jigsaw.w3.org", "/HTTP/300/302.html",
"Content-Type", "application/x-www-form-urlencoded");
"Content-Type", "application/x-www-form-urlencoded");
"GET", "pigeonhole.dovecot.org", "/",
"GET", "pigeonhole.dovecot.org", "/",
"GET", "wiki2.dovecot.org", "/Pigeonhole",
"POST", "jigsaw.w3.org", "/HTTP/300/Go_307",
"POST", "jigsaw.w3.org", "/HTTP/300/Go_307",
"POST", "jigsaw.w3.org", "/HTTP/300/Go_307",
}
static void
struct http_client_request **http_req_r,
struct http_test_request **test_req_r)
{
const char *error;
*http_req_r = http_req;
*test_req_r = test_req;
}
{
}
const char *path)
{
}
{
const char *error;
lib_init();
#ifdef HAVE_OPENSSL
#endif
ioloop = io_loop_create();
/* kludge: use safe_memset() here since otherwise it's not included in
the binary in all systems (but is in others! so linking
safe-memset.lo directly causes them to fail.) If safe_memset() isn't
included, libssl-iostream plugin loading fails. */
/* check if there is a DNS client */
} else {
dns_client = NULL;
}
switch (argc) {
case 1:
break;
case 2:
break;
case 3:
break;
default:
i_fatal("Too many parameters");
}
for (;;) {
if (http_client_get_pending_request_count(http_client1) > 0) {
i_debug("Requests still pending in client 1");
} else if (http_client_get_pending_request_count(http_client2) > 0) {
i_debug("Requests still pending in client 2");
} else if (http_client_get_pending_request_count(http_client3) > 0) {
i_debug("Requests still pending in client 3");
} else if (http_client_get_pending_request_count(http_client4) > 0) {
i_debug("Requests still pending in client 4");
}
if (!pending)
break;
}
if (dns_client != NULL)
#ifdef HAVE_OPENSSL
#endif
lib_deinit();
}