summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2022-05-08 14:54:53 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2022-05-11 23:51:48 -0400
commitd22e88b7d9fdec286754f321b53b7cdd81d117c4 (patch)
treefc12d564131c6f2095c1cf74daf221d60ce6d1ee /src/buffer.h
parent04f2fcf8f0020a131c21c48d92afeee1a91b76b6 (diff)
downloadlighttpd-git-d22e88b7d9fdec286754f321b53b7cdd81d117c4.tar.gz
[core] buffer_append_bs_escaped()
move accesslog_append_escaped() to buffer_append_bs_escaped() replace buffer_append_string_encoded_json()
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 9c8e4804..14fef70a 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -179,12 +179,18 @@ typedef enum {
void buffer_append_string_encoded(buffer * restrict b, const char * restrict s, size_t s_len, buffer_encoding_t encoding);
-void buffer_append_string_encoded_json(buffer * restrict b, const char * restrict s, size_t len);
-
/* escape non-printable characters; simple escapes for \t, \r, \n; fallback to \xCC */
__attribute_nonnull__()
void buffer_append_string_c_escaped(buffer * restrict b, const char * restrict s, size_t s_len);
+typedef enum {
+ BS_ESCAPE_DEFAULT
+ ,BS_ESCAPE_JSON
+} buffer_bs_escape_t;
+
+/* escape non-printable chars, '"', '\\', and chars which high bit set */
+void buffer_append_bs_escaped (buffer * restrict b, const char * restrict s, size_t len, buffer_bs_escape_t esc);
+
__attribute_nonnull__()
void buffer_urldecode_path(buffer *b);