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
224d1858
Commit
224d1858
authored
Nov 02, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed -DNO_SSL build
parent
2fd71918
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
6 deletions
+18
-6
http_client.c
build/src/http_client.c
+5
-1
mongoose.c
build/src/mongoose.c
+4
-1
ssl.c
build/src/ssl.c
+0
-1
mongoose.c
mongoose.c
+9
-3
No files found.
build/src/http_client.c
View file @
224d1858
...
@@ -3,14 +3,18 @@
...
@@ -3,14 +3,18 @@
static
SOCKET
conn2
(
const
char
*
host
,
int
port
,
int
use_ssl
,
static
SOCKET
conn2
(
const
char
*
host
,
int
port
,
int
use_ssl
,
char
*
ebuf
,
size_t
ebuf_len
)
{
char
*
ebuf
,
size_t
ebuf_len
)
{
struct
sockaddr_in
sin
;
struct
sockaddr_in
sin
;
struct
hostent
*
he
;
struct
hostent
*
he
=
NULL
;
SOCKET
sock
=
INVALID_SOCKET
;
SOCKET
sock
=
INVALID_SOCKET
;
(
void
)
use_ssl
;
// Prevent warning for -DNO_SSL case
if
(
host
==
NULL
)
{
if
(
host
==
NULL
)
{
snprintf
(
ebuf
,
ebuf_len
,
"%s"
,
"NULL host"
);
snprintf
(
ebuf
,
ebuf_len
,
"%s"
,
"NULL host"
);
#ifndef NO_SSL
}
else
if
(
use_ssl
&&
SSLv23_client_method
==
NULL
)
{
}
else
if
(
use_ssl
&&
SSLv23_client_method
==
NULL
)
{
snprintf
(
ebuf
,
ebuf_len
,
"%s"
,
"SSL is not initialized"
);
snprintf
(
ebuf
,
ebuf_len
,
"%s"
,
"SSL is not initialized"
);
// TODO(lsm): use something threadsafe instead of gethostbyname()
// TODO(lsm): use something threadsafe instead of gethostbyname()
#endif
}
else
if
((
he
=
gethostbyname
(
host
))
==
NULL
)
{
}
else
if
((
he
=
gethostbyname
(
host
))
==
NULL
)
{
snprintf
(
ebuf
,
ebuf_len
,
"gethostbyname(%s): %s"
,
host
,
strerror
(
ERRNO
));
snprintf
(
ebuf
,
ebuf_len
,
"gethostbyname(%s): %s"
,
host
,
strerror
(
ERRNO
));
}
else
if
((
sock
=
socket
(
PF_INET
,
SOCK_STREAM
,
0
))
==
INVALID_SOCKET
)
{
}
else
if
((
sock
=
socket
(
PF_INET
,
SOCK_STREAM
,
0
))
==
INVALID_SOCKET
)
{
...
...
build/src/mongoose.c
View file @
224d1858
...
@@ -149,9 +149,12 @@ static int64_t push(FILE *fp, SOCKET sock, SSL *ssl, const char *buf,
...
@@ -149,9 +149,12 @@ static int64_t push(FILE *fp, SOCKET sock, SSL *ssl, const char *buf,
// How many bytes we send in this iteration
// How many bytes we send in this iteration
k
=
len
-
sent
>
INT_MAX
?
INT_MAX
:
(
int
)
(
len
-
sent
);
k
=
len
-
sent
>
INT_MAX
?
INT_MAX
:
(
int
)
(
len
-
sent
);
#if !defined(NO_SSL)
if
(
ssl
!=
NULL
)
{
if
(
ssl
!=
NULL
)
{
n
=
SSL_write
(
ssl
,
buf
+
sent
,
k
);
n
=
SSL_write
(
ssl
,
buf
+
sent
,
k
);
}
else
if
(
fp
!=
NULL
)
{
}
else
#endif
if
(
fp
!=
NULL
)
{
n
=
(
int
)
fwrite
(
buf
+
sent
,
1
,
(
size_t
)
k
,
fp
);
n
=
(
int
)
fwrite
(
buf
+
sent
,
1
,
(
size_t
)
k
,
fp
);
if
(
ferror
(
fp
))
if
(
ferror
(
fp
))
n
=
-
1
;
n
=
-
1
;
...
...
build/src/ssl.c
View file @
224d1858
...
@@ -176,4 +176,3 @@ static void uninitialize_ssl(struct mg_context *ctx) {
...
@@ -176,4 +176,3 @@ static void uninitialize_ssl(struct mg_context *ctx) {
}
}
}
}
#endif // !NO_SSL
#endif // !NO_SSL
mongoose.c
View file @
224d1858
...
@@ -2072,18 +2072,21 @@ static void uninitialize_ssl(struct mg_context *ctx) {
...
@@ -2072,18 +2072,21 @@ static void uninitialize_ssl(struct mg_context *ctx) {
}
}
#endif // !NO_SSL
#endif // !NO_SSL
static
SOCKET
conn2
(
const
char
*
host
,
int
port
,
int
use_ssl
,
static
SOCKET
conn2
(
const
char
*
host
,
int
port
,
int
use_ssl
,
char
*
ebuf
,
size_t
ebuf_len
)
{
char
*
ebuf
,
size_t
ebuf_len
)
{
struct
sockaddr_in
sin
;
struct
sockaddr_in
sin
;
struct
hostent
*
he
;
struct
hostent
*
he
=
NULL
;
SOCKET
sock
=
INVALID_SOCKET
;
SOCKET
sock
=
INVALID_SOCKET
;
(
void
)
use_ssl
;
// Prevent warning for -DNO_SSL case
if
(
host
==
NULL
)
{
if
(
host
==
NULL
)
{
snprintf
(
ebuf
,
ebuf_len
,
"%s"
,
"NULL host"
);
snprintf
(
ebuf
,
ebuf_len
,
"%s"
,
"NULL host"
);
#ifndef NO_SSL
}
else
if
(
use_ssl
&&
SSLv23_client_method
==
NULL
)
{
}
else
if
(
use_ssl
&&
SSLv23_client_method
==
NULL
)
{
snprintf
(
ebuf
,
ebuf_len
,
"%s"
,
"SSL is not initialized"
);
snprintf
(
ebuf
,
ebuf_len
,
"%s"
,
"SSL is not initialized"
);
// TODO(lsm): use something threadsafe instead of gethostbyname()
// TODO(lsm): use something threadsafe instead of gethostbyname()
#endif
}
else
if
((
he
=
gethostbyname
(
host
))
==
NULL
)
{
}
else
if
((
he
=
gethostbyname
(
host
))
==
NULL
)
{
snprintf
(
ebuf
,
ebuf_len
,
"gethostbyname(%s): %s"
,
host
,
strerror
(
ERRNO
));
snprintf
(
ebuf
,
ebuf_len
,
"gethostbyname(%s): %s"
,
host
,
strerror
(
ERRNO
));
}
else
if
((
sock
=
socket
(
PF_INET
,
SOCK_STREAM
,
0
))
==
INVALID_SOCKET
)
{
}
else
if
((
sock
=
socket
(
PF_INET
,
SOCK_STREAM
,
0
))
==
INVALID_SOCKET
)
{
...
@@ -2314,9 +2317,12 @@ static int64_t push(FILE *fp, SOCKET sock, SSL *ssl, const char *buf,
...
@@ -2314,9 +2317,12 @@ static int64_t push(FILE *fp, SOCKET sock, SSL *ssl, const char *buf,
// How many bytes we send in this iteration
// How many bytes we send in this iteration
k
=
len
-
sent
>
INT_MAX
?
INT_MAX
:
(
int
)
(
len
-
sent
);
k
=
len
-
sent
>
INT_MAX
?
INT_MAX
:
(
int
)
(
len
-
sent
);
#if !defined(NO_SSL)
if
(
ssl
!=
NULL
)
{
if
(
ssl
!=
NULL
)
{
n
=
SSL_write
(
ssl
,
buf
+
sent
,
k
);
n
=
SSL_write
(
ssl
,
buf
+
sent
,
k
);
}
else
if
(
fp
!=
NULL
)
{
}
else
#endif
if
(
fp
!=
NULL
)
{
n
=
(
int
)
fwrite
(
buf
+
sent
,
1
,
(
size_t
)
k
,
fp
);
n
=
(
int
)
fwrite
(
buf
+
sent
,
1
,
(
size_t
)
k
,
fp
);
if
(
ferror
(
fp
))
if
(
ferror
(
fp
))
n
=
-
1
;
n
=
-
1
;
...
...
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