mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-28 07:28:13 +08:00
SSL error logging my Martin Lamb
This commit is contained in:
parent
57157edc66
commit
e8db81e33b
@ -477,7 +477,8 @@ cry(struct mg_connection *conn, const char *fmt, ...)
|
|||||||
(void) fprintf(fp, "%s", buf);
|
(void) fprintf(fp, "%s", buf);
|
||||||
fputc('\n', fp);
|
fputc('\n', fp);
|
||||||
funlockfile(fp);
|
funlockfile(fp);
|
||||||
if (fp != stderr) fclose(fp);
|
if (fp != stderr)
|
||||||
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
conn->request_info.log_message = NULL;
|
conn->request_info.log_message = NULL;
|
||||||
@ -488,16 +489,16 @@ cry(struct mg_connection *conn, const char *fmt, ...)
|
|||||||
*/
|
*/
|
||||||
static void ssl_cry(struct mg_connection *conn, const char *fmt, ...) {
|
static void ssl_cry(struct mg_connection *conn, const char *fmt, ...) {
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
|
unsigned long err;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
/* first just log the mongoose-level error message passed in via fmt, etc. */
|
/* Log Mongoose message */
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
(void) vsnprintf(buf, sizeof(buf), fmt, ap);
|
(void) vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
cry(conn, buf);
|
cry(conn, buf);
|
||||||
|
|
||||||
/* then loop through any unlogged OpenSSL errors */
|
/* Loop through any unlogged OpenSSL errors */
|
||||||
unsigned long err;
|
|
||||||
while ((err = ERR_get_error()) != 0) {
|
while ((err = ERR_get_error()) != 0) {
|
||||||
cry(conn, " --> OpenSSL: %s", ERR_error_string(err, NULL));
|
cry(conn, " --> OpenSSL: %s", ERR_error_string(err, NULL));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user