libmicrohttpd-0.9.33/ 0000755 0001750 0001750 00000000000 12255341026 011453 5 0000000 0000000 libmicrohttpd-0.9.33/src/ 0000755 0001750 0001750 00000000000 12255341026 012242 5 0000000 0000000 libmicrohttpd-0.9.33/src/testspdy/ 0000755 0001750 0001750 00000000000 12255341026 014121 5 0000000 0000000 libmicrohttpd-0.9.33/src/testspdy/test_notls.c 0000644 0001750 0001750 00000055313 12216711177 016417 0000000 0000000 /*
This file is part of libmicrospdy
Copyright (C) 2012 Andrey Uzunov
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
/**
* @file request_response.c
* @brief tests receiving request and sending response. spdycli.c (spdylay)
* code is reused here
* @author Andrey Uzunov
* @author Tatsuhiro Tsujikawa
*/
#include "platform.h"
#include "microspdy.h"
#include
#include "common.h"
#define RESPONSE_BODY "Hi, this is libmicrospdy!"
#define CLS "anything"
pid_t parent;
pid_t child;
char *rcvbuf;
int rcvbuf_c = 0;
int session_closed_called = 0;
void
killchild(int pid, char *message)
{
printf("%s\n",message);
kill(pid, SIGKILL);
exit(1);
}
void
killparent(int pid, char *message)
{
printf("%s\n",message);
kill(pid, SIGKILL);
_exit(1);
}
/*****
* start of code needed to utilize spdylay
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
enum {
IO_NONE,
WANT_READ,
WANT_WRITE
};
struct Connection {
spdylay_session *session;
/* WANT_READ if SSL connection needs more input; or WANT_WRITE if it
needs more output; or IO_NONE. This is necessary because SSL/TLS
re-negotiation is possible at any time. Spdylay API offers
similar functions like spdylay_session_want_read() and
spdylay_session_want_write() but they do not take into account
SSL connection. */
int want_io;
int fd;
};
struct Request {
char *host;
uint16_t port;
/* In this program, path contains query component as well. */
char *path;
/* This is the concatenation of host and port with ":" in
between. */
char *hostport;
/* Stream ID for this request. */
int32_t stream_id;
/* The gzip stream inflater for the compressed response. */
spdylay_gzip *inflater;
};
struct URI {
const char *host;
size_t hostlen;
uint16_t port;
/* In this program, path contains query component as well. */
const char *path;
size_t pathlen;
const char *hostport;
size_t hostportlen;
};
/*
* Returns copy of string |s| with the length |len|. The returned
* string is NULL-terminated.
*/
static char* strcopy(const char *s, size_t len)
{
char *dst;
dst = malloc(len+1);
memcpy(dst, s, len);
dst[len] = '\0';
return dst;
}
/*
* Prints error message |msg| and exit.
*/
static void die(const char *msg)
{
fprintf(stderr, "FATAL: %s\n", msg);
exit(EXIT_FAILURE);
}
/*
* Prints error containing the function name |func| and message |msg|
* and exit.
*/
static void dief(const char *func, const char *msg)
{
fprintf(stderr, "FATAL: %s: %s\n", func, msg);
exit(EXIT_FAILURE);
}
/*
* Prints error containing the function name |func| and error code
* |error_code| and exit.
*/
static void diec(const char *func, int error_code)
{
fprintf(stderr, "FATAL: %s: error_code=%d, msg=%s\n", func, error_code,
spdylay_strerror(error_code));
exit(EXIT_FAILURE);
}
/*
* Check response is content-encoding: gzip. We need this because SPDY
* client is required to support gzip.
*/
static void check_gzip(struct Request *req, char **nv)
{
int gzip = 0;
size_t i;
for(i = 0; nv[i]; i += 2) {
if(strcmp("content-encoding", nv[i]) == 0) {
gzip = strcmp("gzip", nv[i+1]) == 0;
break;
}
}
if(gzip) {
int rv;
if(req->inflater) {
return;
}
rv = spdylay_gzip_inflate_new(&req->inflater);
if(rv != 0) {
die("Can't allocate inflate stream.");
}
}
}
/*
* The implementation of spdylay_send_callback type. Here we write
* |data| with size |length| to the network and return the number of
* bytes actually written. See the documentation of
* spdylay_send_callback for the details.
*/
static ssize_t send_callback(spdylay_session *session,
const uint8_t *data, size_t length, int flags,
void *user_data)
{
(void)session;
(void)flags;
struct Connection *connection;
ssize_t rv;
connection = (struct Connection*)user_data;
connection->want_io = IO_NONE;
rv = write(connection->fd,
data,
length);
if (rv < 0)
{
switch(errno)
{
case EAGAIN:
#if EAGAIN != EWOULDBLOCK
case EWOULDBLOCK:
#endif
connection->want_io = WANT_WRITE;
rv = SPDYLAY_ERR_WOULDBLOCK;
break;
default:
rv = SPDYLAY_ERR_CALLBACK_FAILURE;
}
}
return rv;
}
/*
* The implementation of spdylay_recv_callback type. Here we read data
* from the network and write them in |buf|. The capacity of |buf| is
* |length| bytes. Returns the number of bytes stored in |buf|. See
* the documentation of spdylay_recv_callback for the details.
*/
static ssize_t recv_callback(spdylay_session *session,
uint8_t *buf, size_t length, int flags,
void *user_data)
{
(void)session;
(void)flags;
struct Connection *connection;
ssize_t rv;
connection = (struct Connection*)user_data;
connection->want_io = IO_NONE;
rv = read(connection->fd,
buf,
length);
if (rv < 0)
{
switch(errno)
{
case EAGAIN:
#if EAGAIN != EWOULDBLOCK
case EWOULDBLOCK:
#endif
connection->want_io = WANT_READ;
rv = SPDYLAY_ERR_WOULDBLOCK;
break;
default:
rv = SPDYLAY_ERR_CALLBACK_FAILURE;
}
}
else if(rv == 0)
rv = SPDYLAY_ERR_EOF;
return rv;
}
/*
* The implementation of spdylay_before_ctrl_send_callback type. We
* use this function to get stream ID of the request. This is because
* stream ID is not known when we submit the request
* (spdylay_submit_request).
*/
static void before_ctrl_send_callback(spdylay_session *session,
spdylay_frame_type type,
spdylay_frame *frame,
void *user_data)
{
(void)user_data;
if(type == SPDYLAY_SYN_STREAM) {
struct Request *req;
int stream_id = frame->syn_stream.stream_id;
req = spdylay_session_get_stream_user_data(session, stream_id);
if(req && req->stream_id == -1) {
req->stream_id = stream_id;
printf("[INFO] Stream ID = %d\n", stream_id);
}
}
}
static void on_ctrl_send_callback(spdylay_session *session,
spdylay_frame_type type,
spdylay_frame *frame, void *user_data)
{
(void)user_data;
char **nv;
const char *name = NULL;
int32_t stream_id;
size_t i;
switch(type) {
case SPDYLAY_SYN_STREAM:
nv = frame->syn_stream.nv;
name = "SYN_STREAM";
stream_id = frame->syn_stream.stream_id;
break;
default:
break;
}
if(name && spdylay_session_get_stream_user_data(session, stream_id)) {
printf("[INFO] C ----------------------------> S (%s)\n", name);
for(i = 0; nv[i]; i += 2) {
printf(" %s: %s\n", nv[i], nv[i+1]);
}
}
}
static void on_ctrl_recv_callback(spdylay_session *session,
spdylay_frame_type type,
spdylay_frame *frame, void *user_data)
{
(void)user_data;
struct Request *req;
char **nv;
const char *name = NULL;
int32_t stream_id;
size_t i;
switch(type) {
case SPDYLAY_SYN_REPLY:
nv = frame->syn_reply.nv;
name = "SYN_REPLY";
stream_id = frame->syn_reply.stream_id;
break;
case SPDYLAY_HEADERS:
nv = frame->headers.nv;
name = "HEADERS";
stream_id = frame->headers.stream_id;
break;
default:
break;
}
if(!name) {
return;
}
req = spdylay_session_get_stream_user_data(session, stream_id);
if(req) {
check_gzip(req, nv);
printf("[INFO] C <---------------------------- S (%s)\n", name);
for(i = 0; nv[i]; i += 2) {
printf(" %s: %s\n", nv[i], nv[i+1]);
}
}
}
/*
* The implementation of spdylay_on_stream_close_callback type. We use
* this function to know the response is fully received. Since we just
* fetch 1 resource in this program, after reception of the response,
* we submit GOAWAY and close the session.
*/
static void on_stream_close_callback(spdylay_session *session,
int32_t stream_id,
spdylay_status_code status_code,
void *user_data)
{
(void)status_code;
(void)user_data;
struct Request *req;
req = spdylay_session_get_stream_user_data(session, stream_id);
if(req) {
int rv;
rv = spdylay_submit_goaway(session, SPDYLAY_GOAWAY_OK);
if(rv != 0) {
diec("spdylay_submit_goaway", rv);
}
}
}
#define MAX_OUTLEN 4096
/*
* The implementation of spdylay_on_data_chunk_recv_callback type. We
* use this function to print the received response body.
*/
static void on_data_chunk_recv_callback(spdylay_session *session, uint8_t flags,
int32_t stream_id,
const uint8_t *data, size_t len,
void *user_data)
{
(void)flags;
(void)user_data;
struct Request *req;
req = spdylay_session_get_stream_user_data(session, stream_id);
if(req) {
printf("[INFO] C <---------------------------- S (DATA)\n");
printf(" %lu bytes\n", (unsigned long int)len);
if(req->inflater) {
while(len > 0) {
uint8_t out[MAX_OUTLEN];
size_t outlen = MAX_OUTLEN;
size_t tlen = len;
int rv;
rv = spdylay_gzip_inflate(req->inflater, out, &outlen, data, &tlen);
if(rv == -1) {
spdylay_submit_rst_stream(session, stream_id, SPDYLAY_INTERNAL_ERROR);
break;
}
fwrite(out, 1, outlen, stdout);
data += tlen;
len -= tlen;
}
} else {
/* TODO add support gzip */
fwrite(data, 1, len, stdout);
//check if the data is correct
//if(strcmp(RESPONSE_BODY, data) != 0)
//killparent(parent, "\nreceived data is not the same");
if(len + rcvbuf_c > strlen(RESPONSE_BODY))
killparent(parent, "\nreceived data is not the same");
strcpy(rcvbuf + rcvbuf_c,(char*)data);
rcvbuf_c+=len;
}
printf("\n");
}
}
/*
* Setup callback functions. Spdylay API offers many callback
* functions, but most of them are optional. The send_callback is
* always required. Since we use spdylay_session_recv(), the
* recv_callback is also required.
*/
static void setup_spdylay_callbacks(spdylay_session_callbacks *callbacks)
{
memset(callbacks, 0, sizeof(spdylay_session_callbacks));
callbacks->send_callback = send_callback;
callbacks->recv_callback = recv_callback;
callbacks->before_ctrl_send_callback = before_ctrl_send_callback;
callbacks->on_ctrl_send_callback = on_ctrl_send_callback;
callbacks->on_ctrl_recv_callback = on_ctrl_recv_callback;
callbacks->on_stream_close_callback = on_stream_close_callback;
callbacks->on_data_chunk_recv_callback = on_data_chunk_recv_callback;
}
/*
* Connects to the host |host| and port |port|. This function returns
* the file descriptor of the client socket.
*/
static int connect_to(const char *host, uint16_t port)
{
struct addrinfo hints;
int fd = -1;
int rv;
char service[NI_MAXSERV];
struct addrinfo *res, *rp;
snprintf(service, sizeof(service), "%u", port);
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
rv = getaddrinfo(host, service, &hints, &res);
if(rv != 0) {
dief("getaddrinfo", gai_strerror(rv));
}
for(rp = res; rp; rp = rp->ai_next) {
fd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
if(fd == -1) {
continue;
}
while((rv = connect(fd, rp->ai_addr, rp->ai_addrlen)) == -1 &&
errno == EINTR);
if(rv == 0) {
break;
}
close(fd);
fd = -1;
dief("connect", strerror(errno));
}
freeaddrinfo(res);
return fd;
}
static void make_non_block(int fd)
{
int flags, rv;
while((flags = fcntl(fd, F_GETFL, 0)) == -1 && errno == EINTR);
if(flags == -1) {
dief("fcntl1", strerror(errno));
}
while((rv = fcntl(fd, F_SETFL, flags | O_NONBLOCK)) == -1 && errno == EINTR);
if(rv == -1) {
dief("fcntl2", strerror(errno));
}
}
/*
* Setting TCP_NODELAY is not mandatory for the SPDY protocol.
*/
static void set_tcp_nodelay(int fd)
{
int val = 1;
int rv;
rv = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &val, (socklen_t)sizeof(val));
if(rv == -1) {
dief("setsockopt", strerror(errno));
}
}
/*
* Update |pollfd| based on the state of |connection|.
*/
static void ctl_poll(struct pollfd *pollfd, struct Connection *connection)
{
pollfd->events = 0;
if(spdylay_session_want_read(connection->session) ||
connection->want_io == WANT_READ) {
pollfd->events |= POLLIN;
}
if(spdylay_session_want_write(connection->session) ||
connection->want_io == WANT_WRITE) {
pollfd->events |= POLLOUT;
}
}
/*
* Submits the request |req| to the connection |connection|. This
* function does not send packets; just append the request to the
* internal queue in |connection->session|.
*/
static void submit_request(struct Connection *connection, struct Request *req)
{
int pri = 0;
int rv;
const char *nv[15];
/* We always use SPDY/3 style header even if the negotiated protocol
version is SPDY/2. The library translates the header name as
necessary. Make sure that the last item is NULL! */
nv[0] = ":method"; nv[1] = "GET";
nv[2] = ":path"; nv[3] = req->path;
nv[4] = ":version"; nv[5] = "HTTP/1.1";
nv[6] = ":scheme"; nv[7] = "https";
nv[8] = ":host"; nv[9] = req->hostport;
nv[10] = "accept"; nv[11] = "*/*";
nv[12] = "user-agent"; nv[13] = "spdylay/"SPDYLAY_VERSION;
nv[14] = NULL;
rv = spdylay_submit_request(connection->session, pri, nv, NULL, req);
if(rv != 0) {
diec("spdylay_submit_request", rv);
}
}
/*
* Performs the network I/O.
*/
static void exec_io(struct Connection *connection)
{
int rv;
rv = spdylay_session_recv(connection->session);
if(rv != 0) {
diec("spdylay_session_recv", rv);
}
rv = spdylay_session_send(connection->session);
if(rv != 0) {
diec("spdylay_session_send", rv);
}
}
static void request_init(struct Request *req, const struct URI *uri)
{
req->host = strcopy(uri->host, uri->hostlen);
req->port = uri->port;
req->path = strcopy(uri->path, uri->pathlen);
req->hostport = strcopy(uri->hostport, uri->hostportlen);
req->stream_id = -1;
req->inflater = NULL;
}
static void request_free(struct Request *req)
{
free(req->host);
free(req->path);
free(req->hostport);
spdylay_gzip_inflate_del(req->inflater);
}
/*
* Fetches the resource denoted by |uri|.
*/
static void fetch_uri(const struct URI *uri)
{
spdylay_session_callbacks callbacks;
int fd;
struct Request req;
struct Connection connection;
int rv;
nfds_t npollfds = 1;
struct pollfd pollfds[1];
uint16_t spdy_proto_version = 3;
request_init(&req, uri);
setup_spdylay_callbacks(&callbacks);
/* Establish connection and setup SSL */
fd = connect_to(req.host, req.port);
connection.fd = fd;
connection.want_io = IO_NONE;
/* Here make file descriptor non-block */
make_non_block(fd);
set_tcp_nodelay(fd);
printf("[INFO] SPDY protocol version = %d\n", spdy_proto_version);
rv = spdylay_session_client_new(&connection.session, spdy_proto_version,
&callbacks, &connection);
if(rv != 0) {
diec("spdylay_session_client_new", rv);
}
/* Submit the HTTP request to the outbound queue. */
submit_request(&connection, &req);
pollfds[0].fd = fd;
ctl_poll(pollfds, &connection);
/* Event loop */
while(spdylay_session_want_read(connection.session) ||
spdylay_session_want_write(connection.session)) {
int nfds = poll(pollfds, npollfds, -1);
if(nfds == -1) {
dief("poll", strerror(errno));
}
if(pollfds[0].revents & (POLLIN | POLLOUT)) {
exec_io(&connection);
}
if((pollfds[0].revents & POLLHUP) || (pollfds[0].revents & POLLERR)) {
die("Connection error");
}
ctl_poll(pollfds, &connection);
}
/* Resource cleanup */
spdylay_session_del(connection.session);
shutdown(fd, SHUT_WR);
close(fd);
request_free(&req);
}
static int parse_uri(struct URI *res, const char *uri)
{
/* We only interested in https */
size_t len, i, offset;
memset(res, 0, sizeof(struct URI));
len = strlen(uri);
if(len < 9 || memcmp("https://", uri, 8) != 0) {
return -1;
}
offset = 8;
res->host = res->hostport = &uri[offset];
res->hostlen = 0;
if(uri[offset] == '[') {
/* IPv6 literal address */
++offset;
++res->host;
for(i = offset; i < len; ++i) {
if(uri[i] == ']') {
res->hostlen = i-offset;
offset = i+1;
break;
}
}
} else {
const char delims[] = ":/?#";
for(i = offset; i < len; ++i) {
if(strchr(delims, uri[i]) != NULL) {
break;
}
}
res->hostlen = i-offset;
offset = i;
}
if(res->hostlen == 0) {
return -1;
}
/* Assuming https */
res->port = 443;
if(offset < len) {
if(uri[offset] == ':') {
/* port */
const char delims[] = "/?#";
int port = 0;
++offset;
for(i = offset; i < len; ++i) {
if(strchr(delims, uri[i]) != NULL) {
break;
}
if('0' <= uri[i] && uri[i] <= '9') {
port *= 10;
port += uri[i]-'0';
if(port > 65535) {
return -1;
}
} else {
return -1;
}
}
if(port == 0) {
return -1;
}
offset = i;
res->port = port;
}
}
res->hostportlen = uri+offset-res->host;
for(i = offset; i < len; ++i) {
if(uri[i] == '#') {
break;
}
}
if(i-offset == 0) {
res->path = "/";
res->pathlen = 1;
} else {
res->path = &uri[offset];
res->pathlen = i-offset;
}
return 0;
}
/*****
* end of code needed to utilize spdylay
*/
/*****
* start of code needed to utilize microspdy
*/
void
standard_request_handler(void *cls,
struct SPDY_Request * request,
uint8_t priority,
const char *method,
const char *path,
const char *version,
const char *host,
const char *scheme,
struct SPDY_NameValue * headers,
bool more)
{
(void)cls;
(void)request;
(void)priority;
(void)host;
(void)scheme;
(void)headers;
(void)method;
(void)version;
(void)more;
struct SPDY_Response *response=NULL;
if(strcmp(CLS,cls)!=0)
{
killchild(child,"wrong cls");
}
response = SPDY_build_response(200,NULL,SPDY_HTTP_VERSION_1_1,NULL,RESPONSE_BODY,strlen(RESPONSE_BODY));
if(NULL==response){
fprintf(stdout,"no response obj\n");
exit(3);
}
if(SPDY_queue_response(request,response,true,false,NULL,(void*)strdup(path))!=SPDY_YES)
{
fprintf(stdout,"queue\n");
exit(4);
}
}
void
session_closed_handler (void *cls,
struct SPDY_Session * session,
int by_client)
{
printf("session_closed_handler called\n");
if(strcmp(CLS,cls)!=0)
{
killchild(child,"wrong cls");
}
if(SPDY_YES != by_client)
{
//killchild(child,"wrong by_client");
printf("session closed by server\n");
}
else
{
printf("session closed by client\n");
}
if(NULL == session)
{
killchild(child,"session is NULL");
}
session_closed_called = 1;
}
/*****
* end of code needed to utilize microspdy
*/
//child process
void
childproc(int port)
{
struct URI uri;
struct sigaction act;
int rv;
char *uristr;
memset(&act, 0, sizeof(struct sigaction));
act.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &act, 0);
usleep(10000);
asprintf(&uristr, "https://127.0.0.1:%i/",port);
if(NULL == (rcvbuf = malloc(strlen(RESPONSE_BODY)+1)))
killparent(parent,"no memory");
rv = parse_uri(&uri, uristr);
if(rv != 0) {
killparent(parent,"parse_uri failed");
}
fetch_uri(&uri);
if(strcmp(rcvbuf, RESPONSE_BODY))
killparent(parent,"received data is different");
}
//parent proc
int
parentproc( int port)
{
int childstatus;
unsigned long long timeoutlong=0;
struct timeval timeout;
int ret;
fd_set read_fd_set;
fd_set write_fd_set;
fd_set except_fd_set;
int maxfd = -1;
struct SPDY_Daemon *daemon;
SPDY_init();
daemon = SPDY_start_daemon(port,
NULL,
NULL,
NULL,&session_closed_handler,&standard_request_handler,NULL,CLS,
SPDY_DAEMON_OPTION_IO_SUBSYSTEM, SPDY_IO_SUBSYSTEM_RAW,
SPDY_DAEMON_OPTION_FLAGS, SPDY_DAEMON_FLAG_NO_DELAY,
SPDY_DAEMON_OPTION_END);
if(NULL==daemon){
printf("no daemon\n");
return 1;
}
do
{
FD_ZERO(&read_fd_set);
FD_ZERO(&write_fd_set);
FD_ZERO(&except_fd_set);
ret = SPDY_get_timeout(daemon, &timeoutlong);
if(SPDY_NO == ret || timeoutlong > 1000)
{
timeout.tv_sec = 1;
timeout.tv_usec = 0;
}
else
{
timeout.tv_sec = timeoutlong / 1000;
timeout.tv_usec = (timeoutlong % 1000) * 1000;
}
maxfd = SPDY_get_fdset (daemon,
&read_fd_set,
&write_fd_set,
&except_fd_set);
ret = select(maxfd+1, &read_fd_set, &write_fd_set, &except_fd_set, &timeout);
switch(ret) {
case -1:
printf("select error: %i\n", errno);
killchild(child, "select error");
break;
case 0:
break;
default:
SPDY_run(daemon);
break;
}
}
while(waitpid(child,&childstatus,WNOHANG) != child);
//give chance to the client to close socket and handle this in run
usleep(100000);
SPDY_run(daemon);
SPDY_stop_daemon(daemon);
SPDY_deinit();
return WEXITSTATUS(childstatus);
}
int main()
{
int port = get_port(12123);
parent = getpid();
child = fork();
if (child == -1)
{
fprintf(stderr, "can't fork, error %d\n", errno);
exit(EXIT_FAILURE);
}
if (child == 0)
{
childproc(port);
_exit(0);
}
else
{
int ret = parentproc(port);
if(1 == session_closed_called && 0 == ret)
exit(0);
else
exit(ret ? ret : 21);
}
return 1;
}
libmicrohttpd-0.9.33/src/testspdy/test_session_timeout.c 0000644 0001750 0001750 00000013741 12220104363 020474 0000000 0000000 /*
This file is part of libmicrospdy
Copyright (C) 2013 Andrey Uzunov
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
/**
* @file session_timeout.c
* @brief tests closing sessions after set timeout. Openssl is used for
* client
* @author Andrey Uzunov
*/
#include "platform.h"
#include "microspdy.h"
#include "stdio.h"
#include
#include
#include "common.h"
#include
#include
#include "../microspdy/internal.h"
#define TIMEOUT 2
#define SELECT_MS_TIMEOUT 20
int port;
pid_t parent;
pid_t child;
int run = 1;
int chunk_size=1;
int new_session;
int closed_session;
int do_sleep;
void
killchild(char *msg)
{
printf("%s\n",msg);
kill(child, SIGKILL);
exit(1);
}
void
killparent(char *msg)
{
printf("%s\n",msg);
kill(parent, SIGKILL);
_exit(1);
}
void
new_session_cb (void *cls,
struct SPDY_Session * session)
{
(void)cls;
(void)session;
if(!new_session)do_sleep = 1;
new_session = 1;
printf("new session\n");
}
void
closed_session_cb (void *cls,
struct SPDY_Session * session,
int by_client)
{
(void)cls;
(void)session;
printf("closed_session_cb called\n");
if(SPDY_YES == by_client)
{
killchild("closed by the client");
}
if(closed_session)
{
killchild("closed_session_cb called twice");
}
closed_session = 1;
}
int
parentproc()
{
int childstatus;
unsigned long long timeoutlong=0;
struct timeval timeout;
int ret;
fd_set read_fd_set;
fd_set write_fd_set;
fd_set except_fd_set;
int maxfd = -1;
struct SPDY_Daemon *daemon;
unsigned long long beginning = 0;
unsigned long long now;
SPDY_init();
daemon = SPDY_start_daemon(port,
DATA_DIR "cert-and-key.pem",
DATA_DIR "cert-and-key.pem",
&new_session_cb,
&closed_session_cb,
NULL,
NULL,
NULL,
SPDY_DAEMON_OPTION_SESSION_TIMEOUT,
TIMEOUT,
SPDY_DAEMON_OPTION_END);
if(NULL==daemon){
printf("no daemon\n");
return 1;
}
do
{
do_sleep=0;
FD_ZERO(&read_fd_set);
FD_ZERO(&write_fd_set);
FD_ZERO(&except_fd_set);
ret = SPDY_get_timeout(daemon, &timeoutlong);
if(new_session && !closed_session)
{
if(SPDY_NO == ret)
{
killchild("SPDY_get_timeout returned wrong SPDY_NO");
}
/*if(timeoutlong)
{
killchild("SPDY_get_timeout returned wrong timeout");
}*/
now = SPDYF_monotonic_time ();
if(now - beginning > TIMEOUT*1000 + SELECT_MS_TIMEOUT)
{
printf("Started at: %llums\n",beginning);
printf("Now is: %llums\n",now);
printf("Timeout is: %i\n",TIMEOUT);
printf("Select Timeout is: %ims\n",SELECT_MS_TIMEOUT);
printf("SPDY_get_timeout gave: %llums\n",timeoutlong);
killchild("Timeout passed but session was not closed");
}
if(timeoutlong > beginning + TIMEOUT *1000)
{
printf("Started at: %llums\n",beginning);
printf("Now is: %llums\n",now);
printf("Timeout is: %i\n",TIMEOUT);
printf("Select Timeout is: %ims\n",SELECT_MS_TIMEOUT);
printf("SPDY_get_timeout gave: %llums\n",timeoutlong);
killchild("SPDY_get_timeout returned wrong timeout");
}
}
else
{
if(SPDY_YES == ret)
{
killchild("SPDY_get_timeout returned wrong SPDY_YES");
}
}
if(SPDY_NO == ret || timeoutlong >= 1000)
{
timeout.tv_sec = 1;
timeout.tv_usec = 0;
}
else
{
timeout.tv_sec = timeoutlong / 1000;
timeout.tv_usec = (timeoutlong % 1000) * 1000;
}
//ignore values
timeout.tv_sec = 0;
timeout.tv_usec = SELECT_MS_TIMEOUT * 1000;
maxfd = SPDY_get_fdset (daemon,
&read_fd_set,
&write_fd_set,
&except_fd_set);
ret = select(maxfd+1, &read_fd_set, &write_fd_set, &except_fd_set, &timeout);
switch(ret) {
case -1:
printf("select error: %i\n", errno);
break;
case 0:
/*if(new_session)
{
killchild("select returned wrong number");
}*/
break;
default:
SPDY_run(daemon);
if(0 == beginning)
{
beginning = SPDYF_monotonic_time ();
}
/*if(do_sleep)
{
sleep(TIMEOUT);
do_sleep = 0;
}*/
break;
}
}
while(waitpid(child,&childstatus,WNOHANG) != child);
if(!new_session || !closed_session)
{
killchild("child is dead, callback wasn't called");
}
ret = SPDY_get_timeout(daemon, &timeoutlong);
if(SPDY_YES == ret)
{
killchild("SPDY_get_timeout returned wrong SPDY_YES after child died");
}
SPDY_stop_daemon(daemon);
SPDY_deinit();
return 0;
}
int
childproc()
{
pid_t devnull;
pid_t out;
out=dup(1);
//close(0);
close(1);
close(2);
/*devnull = open("/dev/null", O_RDONLY);
if (0 != devnull)
{
dup2(devnull, 0);
close(devnull);
}*/
devnull = open("/dev/null", O_WRONLY);
if (1 != devnull)
{
dup2(devnull, 1);
close(devnull);
}
devnull = open("/dev/null", O_WRONLY);
if (2 != devnull)
{
dup2(devnull, 2);
close(devnull);
}
char *uri;
asprintf (&uri, "127.0.0.1:%i", port);
execlp ("openssl", "openssl", "s_client", "-connect", uri, NULL);
close(1);
dup2(out,1);
close(out);
killparent ("executing openssl failed");
return 1;
}
int
main()
{
port = get_port(11123);
parent = getpid();
child = fork();
if (-1 == child)
{
fprintf(stderr, "can't fork, error %d\n", errno);
exit(EXIT_FAILURE);
}
if (child == 0)
{
int ret = childproc();
_exit(ret);
}
else
{
int ret = parentproc();
exit(ret);
}
return 1;
}
libmicrohttpd-0.9.33/src/testspdy/test_misc.c 0000644 0001750 0001750 00000013561 12202003706 016175 0000000 0000000 /*
This file is part of libmicrospdy
Copyright (C) 2013 Andrey Uzunov
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
/**
* @file misc.c
* @brief tests a lot of small calls and callbacks. TODO mention what
* @author Andrey Uzunov
*/
#include "platform.h"
#include "microspdy.h"
#include "stdio.h"
#include
#include "common.h"
int port;
#define HTML "\
\
This is libmicrospdy"
#define CSS "body{font-size:15px}"
#define SESSION_CLS "1234567890"
#define REQUEST_CLS "1234567890REQ"
pid_t parent;
pid_t child;
struct SPDY_Session *session1;
struct SPDY_Session *session2;
void
killchild()
{
kill(child, SIGKILL);
exit(1);
}
void
killparent()
{
kill(parent, SIGKILL);
_exit(1);
}
void
create_child()
{
parent = getpid();
child = fork();
if (-1 == child)
{
fprintf(stderr, "can't fork, error %d\n", errno);
exit(EXIT_FAILURE);
}
if (child == 0)
{
int devnull;
char *uri;
fflush(stdout);
devnull = open("/dev/null", O_WRONLY);
if (1 != devnull)
{
dup2(devnull, 1);
close(devnull);
}
asprintf(&uri,"https://127.0.0.1:%i/",port);
execlp("spdycat", "spdycat","-anv",uri,NULL );
printf("execlp failed\n");
killparent();
}
}
void
response_done_callback(void *cls,
struct SPDY_Response * response,
struct SPDY_Request * request,
enum SPDY_RESPONSE_RESULT status,
bool streamopened)
{
(void)status;
(void)streamopened;
if(strcmp(cls,"/main.css"))
{
session1 = SPDY_get_session_for_request(request);
if(NULL == session1)
{
printf("SPDY_get_session_for_request failed\n");
killchild();
}
char *session_cls = strdup(SESSION_CLS);
SPDY_set_cls_to_session(session1,session_cls);
}
else
{
session2 = SPDY_get_session_for_request(request);
if(session1 != session2)
{
printf("SPDY_get_session_for_request failed the second time\n");
killchild();
}
printf("SPDY_get_session_for_request tested...\n");
void *session_cls = SPDY_get_cls_from_session(session2);
if(NULL == session_cls || strcmp(session_cls, SESSION_CLS))
{
printf("SPDY_get_cls_from_session failed\n");
killchild();
}
printf("SPDY_set_cls_to_session tested...\n");
printf("SPDY_get_cls_from_session tested...\n");
void *request_cls = SPDY_get_cls_from_request(request);
if(NULL == request_cls || strcmp(request_cls, REQUEST_CLS))
{
printf("SPDY_get_cls_from_request failed\n");
killchild();
}
printf("SPDY_set_cls_to_request tested...\n");
printf("SPDY_get_cls_from_request tested...\n");
}
SPDY_destroy_request(request);
SPDY_destroy_response(response);
free(cls);
}
void
standard_request_handler(void *cls,
struct SPDY_Request * request,
uint8_t priority,
const char *method,
const char *path,
const char *version,
const char *host,
const char *scheme,
struct SPDY_NameValue * headers,
bool more)
{
(void)cls;
(void)request;
(void)priority;
(void)host;
(void)scheme;
(void)headers;
(void)method;
(void)version;
(void)more;
struct SPDY_Response *response=NULL;
char *cls_path = strdup(path);
if(strcmp(path,"/main.css")==0)
{
char *request_cls = strdup(REQUEST_CLS);
SPDY_set_cls_to_request(request,request_cls);
response = SPDY_build_response(200,NULL,SPDY_HTTP_VERSION_1_1,NULL,CSS,strlen(CSS));
}
else
{
response = SPDY_build_response(200,NULL,SPDY_HTTP_VERSION_1_1,NULL,HTML,strlen(HTML));
}
if(NULL==response){
fprintf(stdout,"no response obj\n");
killchild();
}
if(SPDY_queue_response(request,response,true,false,&response_done_callback,cls_path)!=SPDY_YES)
{
fprintf(stdout,"queue\n");
killchild();
}
}
int
parentproc()
{
int childstatus;
unsigned long long timeoutlong=0;
struct timeval timeout;
int ret;
fd_set read_fd_set;
fd_set write_fd_set;
fd_set except_fd_set;
int maxfd = -1;
struct SPDY_Daemon *daemon;
daemon = SPDY_start_daemon(port,
DATA_DIR "cert-and-key.pem",
DATA_DIR "cert-and-key.pem",
NULL,
NULL,
&standard_request_handler,
NULL,
NULL,
SPDY_DAEMON_OPTION_SESSION_TIMEOUT,
1800,
SPDY_DAEMON_OPTION_END);
if(NULL==daemon){
printf("no daemon\n");
return 1;
}
create_child();
do
{
FD_ZERO(&read_fd_set);
FD_ZERO(&write_fd_set);
FD_ZERO(&except_fd_set);
ret = SPDY_get_timeout(daemon, &timeoutlong);
if(SPDY_NO == ret || timeoutlong > 1000)
{
timeout.tv_sec = 1;
timeout.tv_usec = 0;
}
else
{
timeout.tv_sec = timeoutlong / 1000;
timeout.tv_usec = (timeoutlong % 1000) * 1000;
}
maxfd = SPDY_get_fdset (daemon,
&read_fd_set,
&write_fd_set,
&except_fd_set);
ret = select(maxfd+1, &read_fd_set, &write_fd_set, &except_fd_set, &timeout);
switch(ret) {
case -1:
printf("select error: %i\n", errno);
break;
case 0:
break;
default:
SPDY_run(daemon);
break;
}
}
while(waitpid(child,&childstatus,WNOHANG) != child);
SPDY_stop_daemon(daemon);
return WEXITSTATUS(childstatus);
}
int
main()
{
port = get_port(13123);
SPDY_init();
int ret = parentproc();
SPDY_deinit();
return ret;
}
libmicrohttpd-0.9.33/src/testspdy/Makefile.in 0000644 0001750 0001750 00000107342 12255340775 016127 0000000 0000000 # Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@USE_COVERAGE_TRUE@am__append_1 = -fprofile-arcs -ftest-coverage
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@check_PROGRAMS = test_daemon_start_stop$(EXEEXT) \
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@ test_daemon_start_stop_many$(EXEEXT) \
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@ test_struct_namevalue$(EXEEXT) \
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@ $(am__EXEEXT_1) \
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@ $(am__EXEEXT_2)
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@am__append_2 = \
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@ test_new_connection \
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@ test_request_response \
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@ test_notls \
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@ test_request_response_with_callback \
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@ test_misc \
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@ test_session_timeout
@ENABLE_SPDY_TRUE@@HAVE_CURL_BINARY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@am__append_3 = \
@ENABLE_SPDY_TRUE@@HAVE_CURL_BINARY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@ test_proxies
subdir = src/testspdy
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libcurl.m4 \
$(top_srcdir)/m4/libgcrypt.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/MHD_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@am__EXEEXT_1 = test_new_connection$(EXEEXT) \
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@ test_request_response$(EXEEXT) \
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@ test_notls$(EXEEXT) \
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@ test_request_response_with_callback$(EXEEXT) \
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@ test_misc$(EXEEXT) \
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@ test_session_timeout$(EXEEXT)
@ENABLE_SPDY_TRUE@@HAVE_CURL_BINARY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@am__EXEEXT_2 = test_proxies$(EXEEXT)
am__objects_1 = common.$(OBJEXT)
am_test_daemon_start_stop_OBJECTS = test_daemon_start_stop.$(OBJEXT) \
$(am__objects_1)
test_daemon_start_stop_OBJECTS = $(am_test_daemon_start_stop_OBJECTS)
am__DEPENDENCIES_1 = $(top_builddir)/src/microspdy/libmicrospdy.la
test_daemon_start_stop_DEPENDENCIES = $(am__DEPENDENCIES_1)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am_test_daemon_start_stop_many_OBJECTS = \
test_daemon_start_stop_many.$(OBJEXT) $(am__objects_1)
test_daemon_start_stop_many_OBJECTS = \
$(am_test_daemon_start_stop_many_OBJECTS)
test_daemon_start_stop_many_DEPENDENCIES = $(am__DEPENDENCIES_1)
am__test_misc_SOURCES_DIST = test_misc.c common.h common.c
@HAVE_SPDYLAY_TRUE@am_test_misc_OBJECTS = test_misc.$(OBJEXT) \
@HAVE_SPDYLAY_TRUE@ $(am__objects_1)
test_misc_OBJECTS = $(am_test_misc_OBJECTS)
@HAVE_SPDYLAY_TRUE@test_misc_DEPENDENCIES = $(am__DEPENDENCIES_1)
am__test_new_connection_SOURCES_DIST = test_new_connection.c common.h \
common.c
@HAVE_SPDYLAY_TRUE@am_test_new_connection_OBJECTS = \
@HAVE_SPDYLAY_TRUE@ test_new_connection.$(OBJEXT) \
@HAVE_SPDYLAY_TRUE@ $(am__objects_1)
test_new_connection_OBJECTS = $(am_test_new_connection_OBJECTS)
@HAVE_SPDYLAY_TRUE@test_new_connection_DEPENDENCIES = \
@HAVE_SPDYLAY_TRUE@ $(am__DEPENDENCIES_1)
am__test_notls_SOURCES_DIST = test_notls.c common.h common.c
@HAVE_SPDYLAY_TRUE@am_test_notls_OBJECTS = test_notls.$(OBJEXT) \
@HAVE_SPDYLAY_TRUE@ $(am__objects_1)
test_notls_OBJECTS = $(am_test_notls_OBJECTS)
@HAVE_SPDYLAY_TRUE@test_notls_DEPENDENCIES = $(am__DEPENDENCIES_1)
am__test_proxies_SOURCES_DIST = test_proxies.c common.h common.c
@HAVE_SPDYLAY_TRUE@am_test_proxies_OBJECTS = test_proxies.$(OBJEXT) \
@HAVE_SPDYLAY_TRUE@ $(am__objects_1)
test_proxies_OBJECTS = $(am_test_proxies_OBJECTS)
@HAVE_SPDYLAY_TRUE@test_proxies_DEPENDENCIES = $(am__DEPENDENCIES_1)
am__test_request_response_SOURCES_DIST = test_request_response.c \
common.h common.c
@HAVE_SPDYLAY_TRUE@am_test_request_response_OBJECTS = \
@HAVE_SPDYLAY_TRUE@ test_request_response.$(OBJEXT) \
@HAVE_SPDYLAY_TRUE@ $(am__objects_1)
test_request_response_OBJECTS = $(am_test_request_response_OBJECTS)
@HAVE_SPDYLAY_TRUE@test_request_response_DEPENDENCIES = \
@HAVE_SPDYLAY_TRUE@ $(am__DEPENDENCIES_1)
am__test_request_response_with_callback_SOURCES_DIST = \
test_request_response_with_callback.c common.h common.c
@HAVE_SPDYLAY_TRUE@am_test_request_response_with_callback_OBJECTS = test_request_response_with_callback.$(OBJEXT) \
@HAVE_SPDYLAY_TRUE@ $(am__objects_1)
test_request_response_with_callback_OBJECTS = \
$(am_test_request_response_with_callback_OBJECTS)
@HAVE_SPDYLAY_TRUE@test_request_response_with_callback_DEPENDENCIES = \
@HAVE_SPDYLAY_TRUE@ $(am__DEPENDENCIES_1)
am__test_session_timeout_SOURCES_DIST = test_session_timeout.c \
common.h common.c
@HAVE_SPDYLAY_TRUE@am_test_session_timeout_OBJECTS = \
@HAVE_SPDYLAY_TRUE@ test_session_timeout.$(OBJEXT) \
@HAVE_SPDYLAY_TRUE@ $(am__objects_1)
test_session_timeout_OBJECTS = $(am_test_session_timeout_OBJECTS)
@HAVE_SPDYLAY_TRUE@test_session_timeout_DEPENDENCIES = \
@HAVE_SPDYLAY_TRUE@ $(am__DEPENDENCIES_1)
am_test_struct_namevalue_OBJECTS = test_struct_namevalue.$(OBJEXT) \
$(am__objects_1)
test_struct_namevalue_OBJECTS = $(am_test_struct_namevalue_OBJECTS)
test_struct_namevalue_DEPENDENCIES = $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
SOURCES = $(test_daemon_start_stop_SOURCES) \
$(test_daemon_start_stop_many_SOURCES) $(test_misc_SOURCES) \
$(test_new_connection_SOURCES) $(test_notls_SOURCES) \
$(test_proxies_SOURCES) $(test_request_response_SOURCES) \
$(test_request_response_with_callback_SOURCES) \
$(test_session_timeout_SOURCES) \
$(test_struct_namevalue_SOURCES)
DIST_SOURCES = $(test_daemon_start_stop_SOURCES) \
$(test_daemon_start_stop_many_SOURCES) \
$(am__test_misc_SOURCES_DIST) \
$(am__test_new_connection_SOURCES_DIST) \
$(am__test_notls_SOURCES_DIST) \
$(am__test_proxies_SOURCES_DIST) \
$(am__test_request_response_SOURCES_DIST) \
$(am__test_request_response_with_callback_SOURCES_DIST) \
$(am__test_session_timeout_SOURCES_DIST) \
$(test_struct_namevalue_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
distdir
ETAGS = etags
CTAGS = ctags
am__tty_colors = \
red=; grn=; lgn=; blu=; std=
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXT_LIBS = @EXT_LIBS@
EXT_LIB_PATH = @EXT_LIB_PATH@
FGREP = @FGREP@
GREP = @GREP@
HAVE_CURL_BINARY = @HAVE_CURL_BINARY@
HAVE_MAKEINFO_BINARY = @HAVE_MAKEINFO_BINARY@
HAVE_SOCAT = @HAVE_SOCAT@
HAVE_ZZUF = @HAVE_ZZUF@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBCURL = @LIBCURL@
LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSPDY_VERSION_AGE = @LIBSPDY_VERSION_AGE@
LIBSPDY_VERSION_CURRENT = @LIBSPDY_VERSION_CURRENT@
LIBSPDY_VERSION_REVISION = @LIBSPDY_VERSION_REVISION@
LIBTOOL = @LIBTOOL@
LIB_VERSION_AGE = @LIB_VERSION_AGE@
LIB_VERSION_CURRENT = @LIB_VERSION_CURRENT@
LIB_VERSION_REVISION = @LIB_VERSION_REVISION@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MHD_LIBDEPS = @MHD_LIBDEPS@
MHD_LIB_LDFLAGS = @MHD_LIB_LDFLAGS@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PLIBC_CPPFLAGS = @PLIBC_CPPFLAGS@
PLIBC_LDFLAGS = @PLIBC_LDFLAGS@
PLIBC_LIBS = @PLIBC_LIBS@
PTHREAD_CPPFLAGS = @PTHREAD_CPPFLAGS@
PTHREAD_LDFLAGS = @PTHREAD_LDFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SPDY_LIBDEPS = @SPDY_LIBDEPS@
SPDY_LIB_LDFLAGS = @SPDY_LIB_LDFLAGS@
STRIP = @STRIP@
VERSION = @VERSION@
_libcurl_config = @_libcurl_config@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = .
AM_CFLAGS = -DDATA_DIR=\"$(top_srcdir)/src/datadir/\" $(am__append_1)
@USE_PRIVATE_PLIBC_H_TRUE@PLIBC_INCLUDE = -I$(top_srcdir)/src/include/plibc
AM_CPPFLAGS = \
$(PLIBC_INCLUDE) \
-I$(top_srcdir) \
-I$(top_srcdir)/src/include \
-I$(top_srcdir)/src/applicationlayer \
$(LIBCURL_CPPFLAGS)
@HAVE_W32_FALSE@PERF_GET_CONCURRENT = perf_get_concurrent
TESTS = $(check_PROGRAMS)
SPDY_SOURCES = \
common.h common.c
SPDY_LDADD = \
$(top_builddir)/src/microspdy/libmicrospdy.la \
-lssl \
-lcrypto \
-lz \
-ldl
test_daemon_start_stop_SOURCES = \
test_daemon_start_stop.c \
$(SPDY_SOURCES)
test_daemon_start_stop_LDADD = $(SPDY_LDADD)
test_daemon_start_stop_many_SOURCES = \
test_daemon_start_stop_many.c \
$(SPDY_SOURCES)
test_daemon_start_stop_many_LDADD = $(SPDY_LDADD)
test_struct_namevalue_SOURCES = \
test_struct_namevalue.c \
$(SPDY_SOURCES)
test_struct_namevalue_LDADD = $(SPDY_LDADD)
@HAVE_SPDYLAY_TRUE@test_new_connection_SOURCES = \
@HAVE_SPDYLAY_TRUE@ test_new_connection.c \
@HAVE_SPDYLAY_TRUE@ $(SPDY_SOURCES)
@HAVE_SPDYLAY_TRUE@test_new_connection_LDADD = $(SPDY_LDADD) \
@HAVE_SPDYLAY_TRUE@ -lspdylay
@HAVE_SPDYLAY_TRUE@test_request_response_SOURCES = \
@HAVE_SPDYLAY_TRUE@ test_request_response.c \
@HAVE_SPDYLAY_TRUE@ $(SPDY_SOURCES)
@HAVE_SPDYLAY_TRUE@test_request_response_LDADD = $(SPDY_LDADD) \
@HAVE_SPDYLAY_TRUE@ -lspdylay
@HAVE_SPDYLAY_TRUE@test_notls_SOURCES = \
@HAVE_SPDYLAY_TRUE@ test_notls.c \
@HAVE_SPDYLAY_TRUE@ $(SPDY_SOURCES)
@HAVE_SPDYLAY_TRUE@test_notls_LDADD = $(SPDY_LDADD) \
@HAVE_SPDYLAY_TRUE@ -lspdylay
@HAVE_SPDYLAY_TRUE@test_request_response_with_callback_SOURCES = \
@HAVE_SPDYLAY_TRUE@ test_request_response_with_callback.c \
@HAVE_SPDYLAY_TRUE@ $(SPDY_SOURCES)
@HAVE_SPDYLAY_TRUE@test_request_response_with_callback_LDADD = $(SPDY_LDADD)
#test_requests_with_assets_SOURCES = \
# test_requests_with_assets.c \
# $(SPDY_SOURCES)
#test_requests_with_assets_LDADD = $(SPDY_LDADD)
@HAVE_SPDYLAY_TRUE@test_misc_SOURCES = \
@HAVE_SPDYLAY_TRUE@ test_misc.c \
@HAVE_SPDYLAY_TRUE@ $(SPDY_SOURCES)
@HAVE_SPDYLAY_TRUE@test_misc_LDADD = $(SPDY_LDADD)
@HAVE_SPDYLAY_TRUE@test_session_timeout_SOURCES = \
@HAVE_SPDYLAY_TRUE@ test_session_timeout.c \
@HAVE_SPDYLAY_TRUE@ $(SPDY_SOURCES)
@HAVE_SPDYLAY_TRUE@test_session_timeout_LDADD = $(SPDY_LDADD)
@HAVE_SPDYLAY_TRUE@test_proxies_SOURCES = \
@HAVE_SPDYLAY_TRUE@ test_proxies.c \
@HAVE_SPDYLAY_TRUE@ $(SPDY_SOURCES)
@HAVE_SPDYLAY_TRUE@test_proxies_LDADD = $(SPDY_LDADD)
all: all-recursive
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/testspdy/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/testspdy/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
test_daemon_start_stop$(EXEEXT): $(test_daemon_start_stop_OBJECTS) $(test_daemon_start_stop_DEPENDENCIES) $(EXTRA_test_daemon_start_stop_DEPENDENCIES)
@rm -f test_daemon_start_stop$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_daemon_start_stop_OBJECTS) $(test_daemon_start_stop_LDADD) $(LIBS)
test_daemon_start_stop_many$(EXEEXT): $(test_daemon_start_stop_many_OBJECTS) $(test_daemon_start_stop_many_DEPENDENCIES) $(EXTRA_test_daemon_start_stop_many_DEPENDENCIES)
@rm -f test_daemon_start_stop_many$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_daemon_start_stop_many_OBJECTS) $(test_daemon_start_stop_many_LDADD) $(LIBS)
test_misc$(EXEEXT): $(test_misc_OBJECTS) $(test_misc_DEPENDENCIES) $(EXTRA_test_misc_DEPENDENCIES)
@rm -f test_misc$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_misc_OBJECTS) $(test_misc_LDADD) $(LIBS)
test_new_connection$(EXEEXT): $(test_new_connection_OBJECTS) $(test_new_connection_DEPENDENCIES) $(EXTRA_test_new_connection_DEPENDENCIES)
@rm -f test_new_connection$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_new_connection_OBJECTS) $(test_new_connection_LDADD) $(LIBS)
test_notls$(EXEEXT): $(test_notls_OBJECTS) $(test_notls_DEPENDENCIES) $(EXTRA_test_notls_DEPENDENCIES)
@rm -f test_notls$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_notls_OBJECTS) $(test_notls_LDADD) $(LIBS)
test_proxies$(EXEEXT): $(test_proxies_OBJECTS) $(test_proxies_DEPENDENCIES) $(EXTRA_test_proxies_DEPENDENCIES)
@rm -f test_proxies$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_proxies_OBJECTS) $(test_proxies_LDADD) $(LIBS)
test_request_response$(EXEEXT): $(test_request_response_OBJECTS) $(test_request_response_DEPENDENCIES) $(EXTRA_test_request_response_DEPENDENCIES)
@rm -f test_request_response$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_request_response_OBJECTS) $(test_request_response_LDADD) $(LIBS)
test_request_response_with_callback$(EXEEXT): $(test_request_response_with_callback_OBJECTS) $(test_request_response_with_callback_DEPENDENCIES) $(EXTRA_test_request_response_with_callback_DEPENDENCIES)
@rm -f test_request_response_with_callback$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_request_response_with_callback_OBJECTS) $(test_request_response_with_callback_LDADD) $(LIBS)
test_session_timeout$(EXEEXT): $(test_session_timeout_OBJECTS) $(test_session_timeout_DEPENDENCIES) $(EXTRA_test_session_timeout_DEPENDENCIES)
@rm -f test_session_timeout$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_session_timeout_OBJECTS) $(test_session_timeout_LDADD) $(LIBS)
test_struct_namevalue$(EXEEXT): $(test_struct_namevalue_OBJECTS) $(test_struct_namevalue_DEPENDENCIES) $(EXTRA_test_struct_namevalue_DEPENDENCIES)
@rm -f test_struct_namevalue$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_struct_namevalue_OBJECTS) $(test_struct_namevalue_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_daemon_start_stop.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_daemon_start_stop_many.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_misc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_new_connection.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_notls.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_proxies.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_request_response.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_request_response_with_callback.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_session_timeout.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_struct_namevalue.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
list=' $(TESTS) '; \
$(am__tty_colors); \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$tst[\ \ ]*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
col=$$red; res=XPASS; \
;; \
*) \
col=$$grn; res=PASS; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$tst[\ \ ]*) \
xfail=`expr $$xfail + 1`; \
col=$$lgn; res=XFAIL; \
;; \
*) \
failed=`expr $$failed + 1`; \
col=$$red; res=FAIL; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
col=$$blu; res=SKIP; \
fi; \
echo "$${col}$$res$${std}: $$tst"; \
done; \
if test "$$all" -eq 1; then \
tests="test"; \
All=""; \
else \
tests="tests"; \
All="All "; \
fi; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="$$All$$all $$tests passed"; \
else \
if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all $$tests failed"; \
else \
if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
if test "$$skip" -eq 1; then \
skipped="($$skip test was not run)"; \
else \
skipped="($$skip tests were not run)"; \
fi; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
if test "$$failed" -eq 0; then \
col="$$grn"; \
else \
col="$$red"; \
fi; \
echo "$${col}$$dashes$${std}"; \
echo "$${col}$$banner$${std}"; \
test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
test -z "$$report" || echo "$${col}$$report$${std}"; \
echo "$${col}$$dashes$${std}"; \
test "$$failed" -eq 0; \
else :; fi
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
mostlyclean-am
distclean: distclean-recursive
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \
ctags-recursive install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-TESTS check-am clean \
clean-checkPROGRAMS clean-generic clean-libtool ctags \
ctags-recursive distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-recursive uninstall uninstall-am
@ENABLE_SPDY_TRUE@@HAVE_OPENSSL_TRUE@@HAVE_SPDYLAY_TRUE@ #test_requests_with_assets
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
libmicrohttpd-0.9.33/src/testspdy/test_proxies.c 0000644 0001750 0001750 00000012261 12211173460 016734 0000000 0000000 /*
This file is part of libmicrospdy
Copyright (C) 2013 Andrey Uzunov
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
/**
* @file test_proxies.c
* @brief test curl > mhd2spdylay > microspdy2http > mhd
* @author Andrey Uzunov
*/
#include "platform.h"
#include "microspdy.h"
#include "common.h"
#include
#include /* printf, stderr, fprintf */
#include /* pid_t */
#include /* _exit, fork */
#include /* exit */
#include /* errno */
#include /* pid_t */
#include "common.h"
#define EXPECTED_BODY "libmicrohttpd demolibmicrohttpd demo"
pid_t parent;
pid_t child_mhd;
pid_t child_spdy2http;
pid_t child_mhd2spdy;
pid_t child_curl;
uint16_t mhd_port;
uint16_t spdy2http_port;
uint16_t mhd2spdy_port;
void
killproc(int pid, const char *message)
{
printf("%s\nkilling %i\n",message,pid);
kill(pid, SIGKILL);
}
void killchildren()
{
if(0 != child_mhd)
killproc(child_mhd,"kill mhd\n");
if(0 != child_spdy2http)
killproc(child_spdy2http,"kill spdy2http\n");
if(0 != child_mhd2spdy)
killproc(child_mhd2spdy,"kill mhd2spdy\n");
if(0 != child_curl)
killproc(child_curl,"kill curl\n");
}
pid_t au_fork()
{
pid_t child = fork();
if (child == -1)
{
killchildren();
killproc(parent,"fork failed\n");
}
return child;
}
int main()
{
//pid_t child;
int childstatus;
pid_t wpid;
parent = getpid();
mhd_port = get_port(4000);
spdy2http_port = get_port(4100);
mhd2spdy_port = get_port(4200);
child_mhd = au_fork();
if (child_mhd == 0)
{
//run MHD
pid_t devnull;
char *port_s;
close(1);
devnull = open("/dev/null", O_WRONLY);
if (1 != devnull)
{
dup2(devnull, 1);
close(devnull);
}
asprintf(&port_s, "%i", mhd_port);
execlp ("../examples/minimal_example", "minimal_example", port_s, NULL);
fprintf(stderr, "executing mhd failed\nFor this test 'make' must be run before 'make check'!\n");
//killchildren();
_exit(1);
}
child_spdy2http = au_fork();
if (child_spdy2http == 0)
{
//run spdy2http
pid_t devnull;
char *port_s;
//char *url;
close(1);
devnull = open("/dev/null", O_WRONLY);
if (1 != devnull)
{
dup2(devnull, 1);
close(devnull);
}
//asprintf(&url, "127.0.0.1:%i", mhd_port);
asprintf(&port_s, "%i", spdy2http_port);
sleep(1);
execlp ("../spdy2http/microspdy2http", "microspdy2http", "-v4rtT", "10", "-p", port_s, NULL);
fprintf(stderr, "executing microspdy2http failed\n");
//killchildren();
_exit(1);
}
child_mhd2spdy = au_fork();
if (child_mhd2spdy == 0)
{
//run MHD2sdpy
pid_t devnull;
char *port_s;
char *url;
close(1);
devnull = open("/dev/null", O_WRONLY);
if (1 != devnull)
{
dup2(devnull, 1);
close(devnull);
}
asprintf(&url, "http://127.0.0.1:%i", spdy2http_port);
asprintf(&port_s, "%i", mhd2spdy_port);
sleep(2);
execlp ("../examples/mhd2spdy", "mhd2spdy", "-vosb", url, "-p", port_s, NULL);
fprintf(stderr, "executing mhd2spdy failed\n");
//killchildren();
_exit(1);
}
child_curl = au_fork();
if (child_curl == 0)
{
//run curl
FILE *p;
pid_t devnull;
char *cmd;
unsigned int i;
char buf[strlen(EXPECTED_BODY) + 1];
close(1);
devnull = open("/dev/null", O_WRONLY);
if (1 != devnull)
{
dup2(devnull, 1);
close(devnull);
}
asprintf (&cmd, "curl --proxy http://127.0.0.1:%i http://127.0.0.1:%i/", mhd2spdy_port, mhd_port);
sleep(3);
p = popen(cmd, "r");
if (p != NULL)
{
for (i = 0; i < strlen(EXPECTED_BODY) && !feof(p); i++)
{
buf[i] = fgetc(p);
}
pclose(p);
buf[i] = 0;
_exit(strcmp(EXPECTED_BODY, buf));
}
fprintf(stderr, "executing curl failed\n");
//killchildren();
_exit(1);
}
do
{
wpid = waitpid(child_mhd,&childstatus,WNOHANG);
if(wpid == child_mhd)
{
fprintf(stderr, "mhd died unexpectedly\n");
killchildren();
return 1;
}
wpid = waitpid(child_spdy2http,&childstatus,WNOHANG);
if(wpid == child_spdy2http)
{
fprintf(stderr, "spdy2http died unexpectedly\n");
killchildren();
return 1;
}
wpid = waitpid(child_mhd2spdy,&childstatus,WNOHANG);
if(wpid == child_mhd2spdy)
{
fprintf(stderr, "mhd2spdy died unexpectedly\n");
killchildren();
return 1;
}
if(waitpid(child_curl,&childstatus,WNOHANG) == child_curl)
{
killchildren();
return WEXITSTATUS(childstatus);
}
sleep(1);
}
while(true);
}
libmicrohttpd-0.9.33/src/testspdy/Makefile.am 0000644 0001750 0001750 00000004577 12217253453 016116 0000000 0000000 SUBDIRS = .
AM_CFLAGS = -DDATA_DIR=\"$(top_srcdir)/src/datadir/\"
if USE_COVERAGE
AM_CFLAGS += -fprofile-arcs -ftest-coverage
endif
if USE_PRIVATE_PLIBC_H
PLIBC_INCLUDE = -I$(top_srcdir)/src/include/plibc
endif
AM_CPPFLAGS = \
$(PLIBC_INCLUDE) \
-I$(top_srcdir) \
-I$(top_srcdir)/src/include \
-I$(top_srcdir)/src/applicationlayer \
$(LIBCURL_CPPFLAGS)
if !HAVE_W32
PERF_GET_CONCURRENT=perf_get_concurrent
endif
if ENABLE_SPDY
if HAVE_OPENSSL
check_PROGRAMS = \
test_daemon_start_stop \
test_daemon_start_stop_many \
test_struct_namevalue
if HAVE_SPDYLAY
check_PROGRAMS += \
test_new_connection \
test_request_response \
test_notls \
test_request_response_with_callback \
test_misc \
test_session_timeout
#test_requests_with_assets
if HAVE_CURL_BINARY
check_PROGRAMS += \
test_proxies
endif
endif
endif
endif
TESTS = $(check_PROGRAMS)
SPDY_SOURCES= \
common.h common.c
SPDY_LDADD= \
$(top_builddir)/src/microspdy/libmicrospdy.la \
-lssl \
-lcrypto \
-lz \
-ldl
test_daemon_start_stop_SOURCES = \
test_daemon_start_stop.c \
$(SPDY_SOURCES)
test_daemon_start_stop_LDADD = $(SPDY_LDADD)
test_daemon_start_stop_many_SOURCES = \
test_daemon_start_stop_many.c \
$(SPDY_SOURCES)
test_daemon_start_stop_many_LDADD = $(SPDY_LDADD)
test_struct_namevalue_SOURCES = \
test_struct_namevalue.c \
$(SPDY_SOURCES)
test_struct_namevalue_LDADD = $(SPDY_LDADD)
if HAVE_SPDYLAY
test_new_connection_SOURCES = \
test_new_connection.c \
$(SPDY_SOURCES)
test_new_connection_LDADD = $(SPDY_LDADD) \
-lspdylay
test_request_response_SOURCES = \
test_request_response.c \
$(SPDY_SOURCES)
test_request_response_LDADD = $(SPDY_LDADD) \
-lspdylay
test_notls_SOURCES = \
test_notls.c \
$(SPDY_SOURCES)
test_notls_LDADD = $(SPDY_LDADD) \
-lspdylay
test_request_response_with_callback_SOURCES = \
test_request_response_with_callback.c \
$(SPDY_SOURCES)
test_request_response_with_callback_LDADD = $(SPDY_LDADD)
#test_requests_with_assets_SOURCES = \
# test_requests_with_assets.c \
# $(SPDY_SOURCES)
#test_requests_with_assets_LDADD = $(SPDY_LDADD)
test_misc_SOURCES = \
test_misc.c \
$(SPDY_SOURCES)
test_misc_LDADD = $(SPDY_LDADD)
test_session_timeout_SOURCES = \
test_session_timeout.c \
$(SPDY_SOURCES)
test_session_timeout_LDADD = $(SPDY_LDADD)
test_proxies_SOURCES = \
test_proxies.c \
$(SPDY_SOURCES)
test_proxies_LDADD = $(SPDY_LDADD)
endif
libmicrohttpd-0.9.33/src/testspdy/test_daemon_start_stop_many.c 0000644 0001750 0001750 00000002747 12202003706 022017 0000000 0000000 /*
This file is part of libmicrospdy
Copyright (C) 2012 Andrey Uzunov
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
/**
* @file daemon_start_stop_many.c
* @brief starts and stops several SPDY daemons, reusing port numbers
* @author Andrey Uzunov
*/
#include "platform.h"
#include "microspdy.h"
#include "common.h"
int
main()
{
int i;
int j;
int num_daemons = 3;
int num_tries = 5;
int port = get_port(15123);
struct SPDY_Daemon *daemon[num_daemons];
SPDY_init();
for(i=0; i