Commit 6083b9c5 authored by Sergey Lyubka's avatar Sergey Lyubka

Updated to the recent skeleton. SSL address format changed

parent 83237a02
This diff is collapsed.
......@@ -396,9 +396,9 @@ static const char *test_server(void) {
ASSERT(mg_set_option(server, "listening_port", LISTENING_ADDR) == NULL);
ASSERT(mg_set_option(server, "document_root", ".") == NULL);
ASSERT((conn = mg_connect(server, "127.0.0.1", atoi(HTTP_PORT), 0)) != NULL);
ASSERT((conn = mg_connect(server, "127.0.0.1:" HTTP_PORT)) != NULL);
conn->connection_param = buf1;
ASSERT((conn = mg_connect(server, "127.0.0.1", atoi(HTTP_PORT), 0)) != NULL);
ASSERT((conn = mg_connect(server, "127.0.0.1:" HTTP_PORT)) != NULL);
conn->connection_param = buf2;
{ int i; for (i = 0; i < 50; i++) mg_poll_server(server, 1); }
......@@ -483,7 +483,7 @@ static const char *test_mg_set_option(void) {
}
static const char *test_rewrites(void) {
char buf1[100] = "xx";
char buf1[100] = "xx", addr[50];
struct mg_server *server = mg_create_server(NULL, evh2);
struct mg_connection *conn;
const char *port;
......@@ -492,7 +492,8 @@ static const char *test_rewrites(void) {
ASSERT(mg_set_option(server, "document_root", ".") == NULL);
ASSERT(mg_set_option(server, "url_rewrites", "/xx=unit_test.c") == NULL);
ASSERT((port = mg_get_option(server, "listening_port")) != NULL);
ASSERT((conn = mg_connect(server, "127.0.0.1", atoi(port), 0)) != NULL);
snprintf(addr, sizeof(addr), "127.0.0.1:%s", port);
ASSERT((conn = mg_connect(server, addr)) != NULL);
conn->connection_param = buf1;
{ int i; for (i = 0; i < 50; i++) mg_poll_server(server, 1); }
......
// Copyright (c) 2013-2014 Cesanta Software Limited
// $Date: 2014-09-08 22:30:52 UTC $
// $Date: 2014-09-09 17:07:55 UTC $
#include <string.h>
#include <time.h>
......
// Copyright (c) 2013-2014 Cesanta Software Limited
// $Date: 2014-09-09 08:27:35 UTC $
// $Date: 2014-09-09 17:07:55 UTC $
#include <string.h>
#include <time.h>
......
# Copyright (c) 2014 Cesanta Software
# All rights reserved
CFLAGS = -W -Wall -I../.. -g -O0 $(CFLAGS_EXTRA)
NS = ../../../net_skeleton
SW = ../../../ssl_wrapper
CFLAGS = -W -Wall -I../.. -I. -g -O0 $(CFLAGS_EXTRA)
SOURCES = ws_ssl.c ../../mongoose.c $(NS)/net_skeleton.c $(SW)/ssl_wrapper.c
SOURCES = ws_ssl.c ../../mongoose.c net_skeleton.c ssl_wrapper.c
PROG = ws_ssl
all: $(PROG)
$(PROG): $(SOURCES)
$(CC) -o $(PROG) $(SOURCES) \
-I$(NS) -DNS_ENABLE_SSL -DNOEMBED_NET_SKELETON \
-I$(SW) -DSSL_WRAPPER_USE_AS_LIBRARY -lssl $(CFLAGS)
-DNS_ENABLE_SSL -DNOEMBED_NET_SKELETON \
-DSSL_WRAPPER_USE_AS_LIBRARY -lssl $(CFLAGS)
clean:
rm -rf $(PROG) *.exe *.dSYM *.obj *.exp .*o *.lib
......@@ -14,7 +14,7 @@
// Alternatively, you can license this software under a commercial
// license, as set out in <http://cesanta.com/>.
//
// $Date: 2014-09-09 16:03:50 UTC $
// $Date: 2014-09-09 17:07:55 UTC $
#include "net_skeleton.h"
......
......@@ -14,7 +14,7 @@
// Alternatively, you can license this software under a commercial
// license, as set out in <http://cesanta.com/>.
//
// $Date: 2014-09-09 16:03:50 UTC $
// $Date: 2014-09-09 17:07:55 UTC $
#ifndef NS_SKELETON_HEADER_INCLUDED
#define NS_SKELETON_HEADER_INCLUDED
......
......@@ -14,7 +14,7 @@
// Alternatively, you can license this software under a commercial
// license, as set out in <http://cesanta.com/products.html>.
//
// $Date: 2014-09-09 16:03:50 UTC $
// $Date: 2014-09-09 17:07:55 UTC $
#include "net_skeleton.h"
#include "ssl_wrapper.h"
......
......@@ -14,7 +14,7 @@
// Alternatively, you can license this software under a commercial
// license, as set out in <http://cesanta.com/products.html>.
//
// $Date: 2014-09-09 16:03:50 UTC $
// $Date: 2014-09-09 17:07:55 UTC $
#ifndef SSL_WRAPPER_HEADER_INCLUDED
#define SSL_WRAPPER_HEADER_INCLUDED
......
This diff is collapsed.
......@@ -15,7 +15,7 @@
// Alternatively, you can license this library under a commercial
// license, as set out in <http://cesanta.com/>.
//
// $Date: 2014-09-01 19:53:26 UTC $
// $Date: 2014-09-09 17:07:55 UTC $
#ifndef MONGOOSE_HEADER_INCLUDED
#define MONGOOSE_HEADER_INCLUDED
......@@ -55,7 +55,7 @@ struct mg_connection {
int wsbits; // First byte of the websocket frame
void *server_param; // Parameter passed to mg_add_uri_handler()
void *connection_param; // Placeholder for connection-specific data
void *callback_param; // Needed by mg_iterate_over_connections()
void *callback_param;
};
struct mg_server; // Opaque structure describing server instance
......@@ -95,11 +95,10 @@ const char **mg_get_valid_option_names(void);
const char *mg_get_option(const struct mg_server *server, const char *name);
void mg_set_listening_socket(struct mg_server *, int sock);
int mg_get_listening_socket(struct mg_server *);
void mg_iterate_over_connections(struct mg_server *, mg_handler_t, void *);
struct mg_connection *mg_next(struct mg_server *, struct mg_connection *);
void mg_wakeup_server(struct mg_server *);
void mg_wakeup_server_ex(struct mg_server *, mg_handler_t, const char *, ...);
struct mg_connection *mg_connect(struct mg_server *, const char *, int, int);
struct mg_connection *mg_connect(struct mg_server *, const char *);
// Connection management functions
void mg_send_status(struct mg_connection *, int status_code);
......@@ -127,6 +126,7 @@ int mg_parse_multipart(const char *buf, int buf_len,
char *file_name, int file_name_len,
const char **data, int *data_len);
// Utility functions
void *mg_start_thread(void *(*func)(void *), void *param);
char *mg_md5(char buf[33], ...);
......@@ -134,7 +134,7 @@ int mg_authorize_digest(struct mg_connection *c, FILE *fp);
int mg_url_encode(const char *src, size_t s_len, char *dst, size_t dst_len);
int mg_url_decode(const char *src, int src_len, char *dst, int dst_len, int);
int mg_terminate_ssl(struct mg_connection *c, const char *cert);
int mg_forward(struct mg_connection *, const char *host, int port, int use_ssl);
int mg_forward(struct mg_connection *c, const char *addr);
void *mg_mmap(FILE *fp, size_t size);
void mg_munmap(void *p, size_t size);
......@@ -147,7 +147,6 @@ struct mg_expansion {
void mg_template(struct mg_connection *, const char *text,
struct mg_expansion *expansions);
#ifdef __cplusplus
}
#endif // __cplusplus
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment