Go to the source code of this file.
|
LWS_VISIBLE LWS_EXTERN const char * | lws_sql_purify (char *escaped, const char *string, size_t len) |
|
int | lws_sql_purify_len (const char *p) |
|
LWS_VISIBLE LWS_EXTERN const char * | lws_json_purify (char *escaped, const char *string, int len, int *in_used) |
|
LWS_VISIBLE LWS_EXTERN int | lws_json_purify_len (const char *string) |
|
LWS_VISIBLE LWS_EXTERN void | lws_filename_purify_inplace (char *filename) |
|
LWS_VISIBLE LWS_EXTERN int | lws_plat_write_cert (struct lws_vhost *vhost, int is_key, int fd, void *buf, size_t len) |
|
LWS_VISIBLE LWS_EXTERN int | lws_plat_write_file (const char *filename, void *buf, size_t len) |
|
LWS_VISIBLE LWS_EXTERN int | lws_plat_read_file (const char *filename, void *buf, size_t len) |
|
LWS_VISIBLE LWS_EXTERN int | lws_plat_recommended_rsa_bits (void) |
|
◆ lws_sql_purify()
lws_sql_purify() - like strncpy but with escaping for sql quotes
- Parameters
-
escaped | output buffer |
string | input buffer ('/0' terminated) |
len | output buffer max length |
Because escaping expands the output string, it's not possible to do it in-place, ie, with escaped == string
◆ lws_sql_purify_len()
int lws_sql_purify_len |
( |
const char * |
p | ) |
|
lws_sql_purify_len() - return length of purified version of input string
- Parameters
-
string | input buffer ('/0' terminated) |
Calculates any character escaping without writing it anywhere and returns the calculated length of the purified string.
◆ lws_json_purify()
LWS_VISIBLE LWS_EXTERN const char* lws_json_purify |
( |
char * |
escaped, |
|
|
const char * |
string, |
|
|
int |
len, |
|
|
int * |
in_used |
|
) |
| |
lws_json_purify() - like strncpy but with escaping for json chars
- Parameters
-
escaped | output buffer |
string | input buffer ('/0' terminated) |
len | output buffer max length |
in_used | number of bytes of string we could escape in len |
Because escaping expands the output string, it's not possible to do it in-place, ie, with escaped == string
◆ lws_json_purify_len()
lws_json_purify_len() - find out the escaped length of a string
- Parameters
-
string | input buffer ('/0' terminated) |
JSON may have to expand escapes by up to 6x the original depending on what it is. This doesn't actually do the escaping but goes through the motions and computes the length of the escaped string.
◆ lws_filename_purify_inplace()
lws_filename_purify_inplace() - replace scary filename chars with underscore
- Parameters
-
filename | filename to be purified |
Replace scary characters in the filename (it should not be a path) with underscore, so it's safe to use.
◆ lws_plat_write_cert()
LWS_VISIBLE LWS_EXTERN int lws_plat_write_cert |
( |
struct lws_vhost * |
vhost, |
|
|
int |
is_key, |
|
|
int |
fd, |
|
|
void * |
buf, |
|
|
size_t |
len |
|
) |
| |
◆ lws_plat_write_file()
◆ lws_plat_read_file()
◆ lws_plat_recommended_rsa_bits()