#include "internal/json_enc.h"
#include "internal/common.h"
#include "internal/cryptlib.h"
+#include "crypto/ctype.h"
-# define BITS_PER_WORD (sizeof(size_t) * 8)
-# define NUM_ENABLED_W ((QLOG_EVENT_TYPE_NUM + BITS_PER_WORD - 1) / BITS_PER_WORD)
+#define BITS_PER_WORD (sizeof(size_t) * 8)
+#define NUM_ENABLED_W ((QLOG_EVENT_TYPE_NUM + BITS_PER_WORD - 1) / BITS_PER_WORD)
static ossl_unused ossl_inline int bit_get(const size_t *p, uint32_t bit_no)
{
qlogdir_sep = ossl_determine_dirsep(qlogdir);
- /* strlen("client" / "server"); strlen(".sqlog"); _; separator; _; NUL */
- strl = l + info->odcid.id_len * 2 + 6 + 7 + 2;
- filename = OPENSSL_malloc(strl + 1);
+ /* dir; [sep]; ODCID; _; strlen("client" / "server"); strlen(".sqlog"); NUL */
+ strl = l + 1 + info->odcid.id_len * 2 + 1 + 6 + 6 + 1;
+ filename = OPENSSL_malloc(strl);
if (filename == NULL)
return NULL;
ossl_json_key(&qlog->json, "system_info");
ossl_json_object_begin(&qlog->json);
{
+#if defined(OPENSSL_SYS_UNIX) || defined(OPENSSL_SYS_WINDOWS)
ossl_json_key(&qlog->json, "process_id");
ossl_json_u64(&qlog->json, (uint64_t)getpid());
+#endif
} /* system_info */
ossl_json_object_end(&qlog->json);
} /* common_fields */
{
ossl_json_key(&qlog->json, "type");
ossl_json_str(&qlog->json, qlog->info.is_server
- ? "server" : "client");
+ ? "server" : "client");
} /* vantage_point */
ossl_json_object_end(&qlog->json);
} /* trace */
static ossl_inline int is_name_char(char c)
{
- return (c >= 'a' && c <= 'z')
- || (c >= 'A' && c <= 'Z')
- || c == '_' || c == '-';
+ return ossl_isalpha(c) || ossl_isdigit(c) || c == '_' || c == '-';
}
static int lex_init(struct lexer *lex, const char *in, size_t in_len)
static int lex_fail(struct lexer *lex, const char *msg)
{
/*
- * TODO(QLOG): Determine how to print log messages about bad filter strings
+ * TODO(QLOG FUTURE): Determine how to print log messages about bad filter
+ * strings
*/
lex->p = lex->term_end = lex->end;
return 0;
(unsigned long long)tcause->error_code);
m = ce;
}
- /* TODO(QLOG): Consider adding ERR information in the output. */
+ /* TODO(QLOG FUTURE): Consider adding ERR information in the output. */
if (m != NULL)
QLOG_STR("connection_code", m);
/*
* Can't continue scanning for frames in this case as the frame length
- * is unknown. We log the entire body the rest of the packet payload
+ * is unknown. We log the entire body of the rest of the packet payload
* as the raw data of the frame.
*/
QLOG_BEGIN("raw");
QLOG_END()
QLOG_END()
}
- /* TODO(QLOG): flags, length */
+ /* TODO(QLOG FUTURE): flags, length */
QLOG_END()
QLOG_U64("datagram_id", datagram_id);