Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
672a6821
Commit
672a6821
authored
9 years ago
by
Marko Mikulicic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a few build issues on OSX
PUBLISHED_FROM=d6e7ab0b45c960a4ca0bcb56cbc26bc05d641374
parent
22cb0efd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
31 deletions
+47
-31
mongoose.c
mongoose.c
+27
-27
mongoose.h
mongoose.h
+20
-4
No files found.
mongoose.c
View file @
672a6821
#include "mongoose.h"
#include "mongoose.h"
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/internal.h"
#line
1
"./src/internal.h"
#endif
#endif
/*
/*
* Copyright (c) 2014 Cesanta Software Limited
* Copyright (c) 2014 Cesanta Software Limited
...
@@ -124,7 +124,7 @@ extern void *(*test_calloc)(size_t count, size_t size);
...
@@ -124,7 +124,7 @@ extern void *(*test_calloc)(size_t count, size_t size);
#endif
/* MG_INTERNAL_HEADER_INCLUDED */
#endif
/* MG_INTERNAL_HEADER_INCLUDED */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/../../common/base64.c"
#line
1
"./src/../../common/base64.c"
#endif
#endif
/*
/*
* Copyright (c) 2014 Cesanta Software Limited
* Copyright (c) 2014 Cesanta Software Limited
...
@@ -327,7 +327,7 @@ int cs_base64_decode(const unsigned char *s, int len, char *dst) {
...
@@ -327,7 +327,7 @@ int cs_base64_decode(const unsigned char *s, int len, char *dst) {
#endif
/* EXCLUDE_COMMON */
#endif
/* EXCLUDE_COMMON */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/../../common/cs_dbg.c"
#line
1
"./src/../../common/cs_dbg.c"
#endif
#endif
/*
/*
* Copyright (c) 2014-2016 Cesanta Software Limited
* Copyright (c) 2014-2016 Cesanta Software Limited
...
@@ -377,7 +377,7 @@ void cs_log_set_level(enum cs_log_level level) {
...
@@ -377,7 +377,7 @@ void cs_log_set_level(enum cs_log_level level) {
#endif
#endif
}
}
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/../../common/cs_dirent.c"
#line
1
"./src/../../common/cs_dirent.c"
#endif
#endif
/*
/*
* Copyright (c) 2015 Cesanta Software Limited
* Copyright (c) 2015 Cesanta Software Limited
...
@@ -515,7 +515,7 @@ int mkdir(const char *path, mode_t mode) {
...
@@ -515,7 +515,7 @@ int mkdir(const char *path, mode_t mode) {
/* ISO C requires a translation unit to contain at least one declaration */
/* ISO C requires a translation unit to contain at least one declaration */
typedef
int
cs_dirent_dummy
;
typedef
int
cs_dirent_dummy
;
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/../../common/cs_time.c"
#line
1
"./src/../../common/cs_time.c"
#endif
#endif
/*
/*
* Copyright (c) 2014-2016 Cesanta Software Limited
* Copyright (c) 2014-2016 Cesanta Software Limited
...
@@ -543,7 +543,7 @@ double cs_time() {
...
@@ -543,7 +543,7 @@ double cs_time() {
return
now
;
return
now
;
}
}
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/../deps/frozen/frozen.c"
#line
1
"./src/../deps/frozen/frozen.c"
#endif
#endif
/*
/*
* Copyright (c) 2004-2013 Sergey Lyubka <valenok@gmail.com>
* Copyright (c) 2004-2013 Sergey Lyubka <valenok@gmail.com>
...
@@ -1138,7 +1138,7 @@ int json_emit(char *buf, int buf_len, const char *fmt, ...) {
...
@@ -1138,7 +1138,7 @@ int json_emit(char *buf, int buf_len, const char *fmt, ...) {
return
len
;
return
len
;
}
}
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/../../common/md5.c"
#line
1
"./src/../../common/md5.c"
#endif
#endif
/*
/*
* This code implements the MD5 message-digest algorithm.
* This code implements the MD5 message-digest algorithm.
...
@@ -1385,7 +1385,7 @@ char *cs_md5(char buf[33], ...) {
...
@@ -1385,7 +1385,7 @@ char *cs_md5(char buf[33], ...) {
#endif
/* EXCLUDE_COMMON */
#endif
/* EXCLUDE_COMMON */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/../../common/mbuf.c"
#line
1
"./src/../../common/mbuf.c"
#endif
#endif
/*
/*
* Copyright (c) 2014 Cesanta Software Limited
* Copyright (c) 2014 Cesanta Software Limited
...
@@ -1482,7 +1482,7 @@ void mbuf_remove(struct mbuf *mb, size_t n) {
...
@@ -1482,7 +1482,7 @@ void mbuf_remove(struct mbuf *mb, size_t n) {
#endif
/* EXCLUDE_COMMON */
#endif
/* EXCLUDE_COMMON */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/../../common/sha1.c"
#line
1
"./src/../../common/sha1.c"
#endif
#endif
/* Copyright(c) By Steve Reid <steve@edmweb.com> */
/* Copyright(c) By Steve Reid <steve@edmweb.com> */
/* 100% Public Domain */
/* 100% Public Domain */
...
@@ -1736,7 +1736,7 @@ void cs_hmac_sha1(const unsigned char *key, size_t keylen,
...
@@ -1736,7 +1736,7 @@ void cs_hmac_sha1(const unsigned char *key, size_t keylen,
#endif
/* EXCLUDE_COMMON */
#endif
/* EXCLUDE_COMMON */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/../../common/str_util.c"
#line
1
"./src/../../common/str_util.c"
#endif
#endif
/*
/*
* Copyright (c) 2015 Cesanta Software Limited
* Copyright (c) 2015 Cesanta Software Limited
...
@@ -2007,7 +2007,7 @@ const char *c_strnstr(const char *s, const char *find, size_t slen) {
...
@@ -2007,7 +2007,7 @@ const char *c_strnstr(const char *s, const char *find, size_t slen) {
#endif
/* EXCLUDE_COMMON */
#endif
/* EXCLUDE_COMMON */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/net.c"
#line
1
"./src/net.c"
#endif
#endif
/*
/*
* Copyright (c) 2014 Cesanta Software Limited
* Copyright (c) 2014 Cesanta Software Limited
...
@@ -3025,7 +3025,7 @@ double mg_time() {
...
@@ -3025,7 +3025,7 @@ double mg_time() {
return
cs_time
();
return
cs_time
();
}
}
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/net_if_socket.c"
#line
1
"./src/net_if_socket.c"
#endif
#endif
/*
/*
* Copyright (c) 2014-2016 Cesanta Software Limited
* Copyright (c) 2014-2016 Cesanta Software Limited
...
@@ -3863,7 +3863,7 @@ void mg_if_get_conn_addr(struct mg_connection *nc, int remote,
...
@@ -3863,7 +3863,7 @@ void mg_if_get_conn_addr(struct mg_connection *nc, int remote,
#endif
/* !MG_DISABLE_SOCKET_IF */
#endif
/* !MG_DISABLE_SOCKET_IF */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/multithreading.c"
#line
1
"./src/multithreading.c"
#endif
#endif
/*
/*
* Copyright (c) 2014 Cesanta Software Limited
* Copyright (c) 2014 Cesanta Software Limited
...
@@ -3932,7 +3932,7 @@ static void spawn_handling_thread(struct mg_connection *nc) {
...
@@ -3932,7 +3932,7 @@ static void spawn_handling_thread(struct mg_connection *nc) {
mg_socketpair
(
sp
,
SOCK_STREAM
);
mg_socketpair
(
sp
,
SOCK_STREAM
);
memset
(
&
dummy
,
0
,
sizeof
(
dummy
));
memset
(
&
dummy
,
0
,
sizeof
(
dummy
));
c
[
0
]
=
mg_add_sock
(
&
dummy
,
sp
[
0
],
forwarder_ev_handler
);
c
[
0
]
=
mg_add_sock
(
&
dummy
,
sp
[
0
],
forwarder_ev_handler
);
c
[
1
]
=
mg_add_sock
(
&
dummy
,
sp
[
1
],
(
mg_event_handler_t
)
nc
->
listener
->
priv_1
);
c
[
1
]
=
mg_add_sock
(
&
dummy
,
sp
[
1
],
nc
->
listener
->
priv_1
.
f
);
/* Interlink client connection with c[0] */
/* Interlink client connection with c[0] */
link_conns
(
c
[
0
],
nc
);
link_conns
(
c
[
0
],
nc
);
...
@@ -3965,12 +3965,12 @@ static void multithreaded_ev_handler(struct mg_connection *c, int ev, void *p) {
...
@@ -3965,12 +3965,12 @@ static void multithreaded_ev_handler(struct mg_connection *c, int ev, void *p) {
void
mg_enable_multithreading
(
struct
mg_connection
*
nc
)
{
void
mg_enable_multithreading
(
struct
mg_connection
*
nc
)
{
/* Wrap user event handler into our multithreaded_ev_handler */
/* Wrap user event handler into our multithreaded_ev_handler */
nc
->
priv_1
=
(
void
*
)
nc
->
handler
;
nc
->
priv_1
.
f
=
nc
->
handler
;
nc
->
handler
=
multithreaded_ev_handler
;
nc
->
handler
=
multithreaded_ev_handler
;
}
}
#endif
#endif
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/uri.c"
#line
1
"./src/uri.c"
#endif
#endif
/*
/*
* Copyright (c) 2014 Cesanta Software Limited
* Copyright (c) 2014 Cesanta Software Limited
...
@@ -4147,7 +4147,7 @@ int mg_normalize_uri_path(const struct mg_str *in, struct mg_str *out) {
...
@@ -4147,7 +4147,7 @@ int mg_normalize_uri_path(const struct mg_str *in, struct mg_str *out) {
return
1
;
return
1
;
}
}
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/http.c"
#line
1
"./src/http.c"
#endif
#endif
/*
/*
* Copyright (c) 2014 Cesanta Software Limited
* Copyright (c) 2014 Cesanta Software Limited
...
@@ -7436,7 +7436,7 @@ void mg_register_http_endpoint(struct mg_connection *nc, const char *uri_path,
...
@@ -7436,7 +7436,7 @@ void mg_register_http_endpoint(struct mg_connection *nc, const char *uri_path,
#endif
/* MG_DISABLE_HTTP */
#endif
/* MG_DISABLE_HTTP */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/util.c"
#line
1
"./src/util.c"
#endif
#endif
/*
/*
* Copyright (c) 2014 Cesanta Software Limited
* Copyright (c) 2014 Cesanta Software Limited
...
@@ -7705,7 +7705,7 @@ void mg_hexdump_connection(struct mg_connection *nc, const char *path,
...
@@ -7705,7 +7705,7 @@ void mg_hexdump_connection(struct mg_connection *nc, const char *path,
MG_SOCK_STRINGIFY_PORT
|
MG_SOCK_STRINGIFY_PORT
|
MG_SOCK_STRINGIFY_REMOTE
);
MG_SOCK_STRINGIFY_REMOTE
);
fprintf
(
fprintf
(
fp
,
"%lu %p %s %s %s %d
\n
"
,
(
unsigned
long
)
time
(
NULL
),
nc
,
src
,
fp
,
"%lu %p %s %s %s %d
\n
"
,
(
unsigned
long
)
time
(
NULL
),
(
void
*
)
nc
,
src
,
ev
==
MG_EV_RECV
?
"<-"
:
ev
==
MG_EV_SEND
ev
==
MG_EV_RECV
?
"<-"
:
ev
==
MG_EV_SEND
?
"->"
?
"->"
:
ev
==
MG_EV_ACCEPT
:
ev
==
MG_EV_ACCEPT
...
@@ -7815,7 +7815,7 @@ struct mg_str mg_mk_str(const char *s) {
...
@@ -7815,7 +7815,7 @@ struct mg_str mg_mk_str(const char *s) {
return
ret
;
return
ret
;
}
}
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/json-rpc.c"
#line
1
"./src/json-rpc.c"
#endif
#endif
/* Copyright (c) 2014 Cesanta Software Limited */
/* Copyright (c) 2014 Cesanta Software Limited */
/* All rights reserved */
/* All rights reserved */
...
@@ -7976,7 +7976,7 @@ int mg_rpc_parse_reply(const char *buf, int len, struct json_token *toks,
...
@@ -7976,7 +7976,7 @@ int mg_rpc_parse_reply(const char *buf, int len, struct json_token *toks,
#endif
/* MG_DISABLE_JSON_RPC */
#endif
/* MG_DISABLE_JSON_RPC */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/mqtt.c"
#line
1
"./src/mqtt.c"
#endif
#endif
/*
/*
* Copyright (c) 2014 Cesanta Software Limited
* Copyright (c) 2014 Cesanta Software Limited
...
@@ -8277,7 +8277,7 @@ void mg_mqtt_disconnect(struct mg_connection *nc) {
...
@@ -8277,7 +8277,7 @@ void mg_mqtt_disconnect(struct mg_connection *nc) {
#endif
/* MG_DISABLE_MQTT */
#endif
/* MG_DISABLE_MQTT */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/mqtt-broker.c"
#line
1
"./src/mqtt-broker.c"
#endif
#endif
/*
/*
* Copyright (c) 2014 Cesanta Software Limited
* Copyright (c) 2014 Cesanta Software Limited
...
@@ -8450,7 +8450,7 @@ struct mg_mqtt_session *mg_mqtt_next(struct mg_mqtt_broker *brk,
...
@@ -8450,7 +8450,7 @@ struct mg_mqtt_session *mg_mqtt_next(struct mg_mqtt_broker *brk,
#endif
/* MG_ENABLE_MQTT_BROKER */
#endif
/* MG_ENABLE_MQTT_BROKER */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/dns.c"
#line
1
"./src/dns.c"
#endif
#endif
/*
/*
* Copyright (c) 2014 Cesanta Software Limited
* Copyright (c) 2014 Cesanta Software Limited
...
@@ -8810,7 +8810,7 @@ void mg_set_protocol_dns(struct mg_connection *nc) {
...
@@ -8810,7 +8810,7 @@ void mg_set_protocol_dns(struct mg_connection *nc) {
#endif
/* MG_DISABLE_DNS */
#endif
/* MG_DISABLE_DNS */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/dns-server.c"
#line
1
"./src/dns-server.c"
#endif
#endif
/*
/*
* Copyright (c) 2014 Cesanta Software Limited
* Copyright (c) 2014 Cesanta Software Limited
...
@@ -8884,7 +8884,7 @@ int mg_dns_reply_record(struct mg_dns_reply *reply,
...
@@ -8884,7 +8884,7 @@ int mg_dns_reply_record(struct mg_dns_reply *reply,
#endif
/* MG_ENABLE_DNS_SERVER */
#endif
/* MG_ENABLE_DNS_SERVER */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/resolv.c"
#line
1
"./src/resolv.c"
#endif
#endif
/*
/*
* Copyright (c) 2014 Cesanta Software Limited
* Copyright (c) 2014 Cesanta Software Limited
...
@@ -9143,7 +9143,7 @@ int mg_resolve_async_opt(struct mg_mgr *mgr, const char *name, int query,
...
@@ -9143,7 +9143,7 @@ int mg_resolve_async_opt(struct mg_mgr *mgr, const char *name, int query,
#endif
/* MG_DISABLE_RESOLVE */
#endif
/* MG_DISABLE_RESOLVE */
#ifdef MG_MODULE_LINES
#ifdef MG_MODULE_LINES
#line
0
"./src/coap.c"
#line
1
"./src/coap.c"
#endif
#endif
/*
/*
* Copyright (c) 2015 Cesanta Software Limited
* Copyright (c) 2015 Cesanta Software Limited
...
@@ -9655,7 +9655,7 @@ uint32_t mg_coap_compose(struct mg_coap_message *cm, struct mbuf *io) {
...
@@ -9655,7 +9655,7 @@ uint32_t mg_coap_compose(struct mg_coap_message *cm, struct mbuf *io) {
}
}
if
(
cm
->
payload
.
len
!=
0
)
{
if
(
cm
->
payload
.
len
!=
0
)
{
*
ptr
=
0xFF
;
*
ptr
=
-
1
;
ptr
++
;
ptr
++
;
memcpy
(
ptr
,
cm
->
payload
.
p
,
cm
->
payload
.
len
);
memcpy
(
ptr
,
cm
->
payload
.
p
,
cm
->
payload
.
len
);
}
}
...
...
This diff is collapsed.
Click to expand it.
mongoose.h
View file @
672a6821
...
@@ -286,6 +286,15 @@ struct dirent *readdir(DIR *dir);
...
@@ -286,6 +286,15 @@ struct dirent *readdir(DIR *dir);
#include <sys/types.h>
#include <sys/types.h>
#include <unistd.h>
#include <unistd.h>
/*
* osx correctly avoids defining strtoll when compiling in strict ansi mode.
* We require strtoll, and if your embedded pre-c99 compiler lacks one, please
* implement a shim.
*/
#if !(defined(__DARWIN_C_LEVEL) && __DARWIN_C_LEVEL >= 200809L)
long
long
strtoll
(
const
char
*
,
char
**
,
int
);
#endif
typedef
int
sock_t
;
typedef
int
sock_t
;
#define INVALID_SOCKET (-1)
#define INVALID_SOCKET (-1)
#define SIZE_T_FMT "zu"
#define SIZE_T_FMT "zu"
...
@@ -1068,10 +1077,17 @@ struct mg_connection {
...
@@ -1068,10 +1077,17 @@ struct mg_connection {
void
*
proto_data
;
/* Protocol-specific data */
void
*
proto_data
;
/* Protocol-specific data */
mg_event_handler_t
handler
;
/* Event handler function */
mg_event_handler_t
handler
;
/* Event handler function */
void
*
user_data
;
/* User-specific data */
void
*
user_data
;
/* User-specific data */
void
*
priv_1
;
/* Used by mg_enable_multithreading() */
union
{
void
*
priv_2
;
/* Used by mg_enable_multithreading() */
void
*
v
;
struct
mbuf
endpoints
;
/* Used by mg_register_http_endpoint */
/*
void
*
mgr_data
;
/* Implementation-specific event manager's data. */
* the C standard is fussy about fitting function pointers into
* void pointers, since some archs might have fat pointers for functions.
*/
mg_event_handler_t
f
;
}
priv_1
;
/* Used by mg_enable_multithreading() */
void
*
priv_2
;
/* Used by mg_enable_multithreading() */
struct
mbuf
endpoints
;
/* Used by mg_register_http_endpoint */
void
*
mgr_data
;
/* Implementation-specific event manager's data. */
#ifdef MG_ENABLE_HTTP_STREAMING_MULTIPART
#ifdef MG_ENABLE_HTTP_STREAMING_MULTIPART
struct
mbuf
strm_state
;
/* Used by multi-part streaming */
struct
mbuf
strm_state
;
/* Used by multi-part streaming */
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment