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
9a5f96e7
Commit
9a5f96e7
authored
Jun 15, 2010
by
valenok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Win32 compilation fixed
parent
f9456c4d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
22 deletions
+32
-22
Makefile
Makefile
+14
-12
mongoose.c
mongoose.c
+15
-3
dll.def
win32/dll.def
+3
-7
No files found.
Makefile
View file @
9a5f96e7
...
...
@@ -48,21 +48,23 @@ solaris:
### WINDOWS build: Using Visual Studio or Mingw
##########################################################################
# Using Visual Studio Express
# 1. Download and install Visual Studio Express 2008 to c:\msvc8
# 2. Download and install Windows SDK to c:\sdk
# 3. Go to c:\msvc8\vc\bin and start "VIsual Studio 2008 Command prompt"
# (or Itanium/amd64 command promt to build x64 version)
# 4. In the command prompt, go to mongoose directory and do "nmake windows"
# Using Visual Studio 6.0
# Assuming that studio is installed in d:\vc6, change VC variable below to
# the correct path on your system. Run "d:\vc6\bin\nmake windows"
VC
=
d:
\v
c2010
\v
c
#VC= d:\vc6
SDK
=
d:
\s
dk
\v
7.1
#WINDBG= /Zi /DDEBUG /Od /DDEBUG
WINDBG
=
/DNDEBUG /Os
WINFLAGS
=
/MT /TC /nologo /W4
$(WINDBG)
WINDBG
=
/DNDEBUG /Os
WINFLAGS
=
/MT /TC /nologo /W4
$(WINDBG)
/I
$(VC)
/include
\
/I
$(SDK)
\i
nclude /link /incremental:no /libpath:
$(VC)
\l
ib
\
/libpath:
$(SDK)
/lib ws2_32.lib
windows
:
cl
$(WINFLAGS)
mongoose.c /link /incremental:no /DLL
\
/DEF:win32
\d
ll.def /out:_
$(PROG)
.dll ws2_32.lib
cl
$(WINFLAGS)
mongoose.c main.c /link /incremental:no
\
/out:
$(PROG)
.exe ws2_32.lib
$(VC)
\b
in
\c
l.exe mongoose.c
$(WINFLAGS)
\
/DLL /DEF:win32
\d
ll.def /out:_
$(PROG)
.dll
$(VC)
\b
in
\c
l.exe mongoose.c main.c
$(WINFLAGS)
/out:
$(PROG)
.exe
# Build for Windows under MinGW
#MINGWDBG= -DDEBUG -O0
...
...
mongoose.c
View file @
9a5f96e7
...
...
@@ -87,9 +87,11 @@ typedef long off_t;
#define STR(x) STRX(x)
#define __func__ "line " STR(__LINE__)
#define strtoull(x, y, z) strtoul(x, y, z)
#define strtoll(x, y, z) strtol(x, y, z)
#else
#define __func__ __FUNCTION__
#define strtoull(x, y, z) _strtoui64(x, y, z)
#define strtoll(x, y, z) _strtoi64(x, y, z)
#endif
/* _MSC_VER */
#define ERRNO GetLastError()
...
...
@@ -99,7 +101,9 @@ typedef long off_t;
#define DIRSEP '\\'
#define IS_DIRSEP_CHAR(c) ((c) == '/' || (c) == '\\')
#define O_NONBLOCK 0
#if !defined(EWOULDBLOCK)
#define EWOULDBLOCK WSAEWOULDBLOCK
#endif
/* !EWOULDBLOCK */
#define _POSIX_
#define INT64_FMT "I64d"
...
...
@@ -125,6 +129,7 @@ typedef long off_t;
#endif
/* !fileno MINGW #defines fileno */
typedef
HANDLE
pthread_mutex_t
;
typedef
HANDLE
pthread_rwlock_t
;
typedef
HANDLE
pthread_cond_t
;
typedef
DWORD
pthread_t
;
#define pid_t HANDLE
/* MINGW typedefs pid_t to int. Using #define here. */
...
...
@@ -136,6 +141,14 @@ struct timespec {
static
int
pthread_mutex_lock
(
pthread_mutex_t
*
);
static
int
pthread_mutex_unlock
(
pthread_mutex_t
*
);
static
FILE
*
mg_fopen
(
const
char
*
path
,
const
char
*
mode
);
/* TODO(lsm): Implement these */
#define pthread_rwlock_init pthread_mutex_init
#define pthread_rwlock_destroy pthread_mutex_destroy
#define pthread_rwlock_rdlock pthread_mutex_lock
#define pthread_rwlock_wrlock pthread_mutex_lock
#define pthread_rwlock_unlock pthread_mutex_unlock
#if defined(HAVE_STDINT)
#include <stdint.h>
...
...
@@ -1500,7 +1513,7 @@ url_decode(const char *src, size_t src_len, char *dst, size_t dst_len,
isxdigit
(
*
(
unsigned
char
*
)
(
src
+
i
+
2
)))
{
a
=
tolower
(
*
(
unsigned
char
*
)
(
src
+
i
+
1
));
b
=
tolower
(
*
(
unsigned
char
*
)
(
src
+
i
+
2
));
dst
[
j
]
=
(
(
HEXTOI
(
a
)
<<
4
)
|
HEXTOI
(
b
))
&
0xff
;
dst
[
j
]
=
(
char
)
((
HEXTOI
(
a
)
<<
4
)
|
HEXTOI
(
b
))
;
i
+=
2
;
}
else
if
(
is_form_url_encoded
&&
src
[
i
]
==
'+'
)
{
dst
[
j
]
=
' '
;
...
...
@@ -2931,7 +2944,6 @@ static bool_t
is_not_modified
(
const
struct
mg_connection
*
conn
,
const
struct
mgstat
*
stp
)
{
const
char
*
ims
=
mg_get_header
(
conn
,
"If-Modified-Since"
);
return
FALSE
;
return
(
ims
!=
NULL
&&
stp
->
mtime
<=
date_to_epoch
(
ims
));
}
...
...
@@ -3457,7 +3469,7 @@ send_ssi_file(struct mg_connection *conn, const char *path, FILE *fp,
while
((
ch
=
fgetc
(
fp
))
!=
EOF
)
{
if
(
in_ssi_tag
&&
ch
==
'>'
)
{
in_ssi_tag
=
FALSE
;
buf
[
len
++
]
=
ch
&
0xff
;
buf
[
len
++
]
=
(
char
)
ch
;
buf
[
len
]
=
'\0'
;
assert
(
len
<=
(
int
)
sizeof
(
buf
));
if
(
len
<
6
||
memcmp
(
buf
,
"<!--#"
,
5
)
!=
0
)
{
...
...
win32/dll.def
View file @
9a5f96e7
...
...
@@ -4,17 +4,13 @@ EXPORTS
mg_stop
mg_get_option
mg_set_option
mg_set_uri_callback
mg_set_error_callback
mg_set_auth_callback
mg_set_ssl_password_callback
mg_set_log_callback
mg_set_callback
mg_write
mg_printf
mg_get_header
mg_authorize
mg_get_var
mg_free
mg_version
mg_show_usage_string
mg_modify_passwords_file
mg_md5
mg_get_cookie
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