mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-02 13:20:51 +00:00
Add RPC API
This commit is contained in:
1 parent
9cacf443e1
commit
0dabc45780
13 files changed
+332
-75
No files matched your search
@@ -64,7 +64,7 @@ static void mg_putchar_iobuf_static(char ch, void *param) {
|
||||
}
|
||||
}
|
||||
|
||||
void mg_putchar_iobuf(char ch, void *param) {
|
||||
void mg_pfn_iobuf(char ch, void *param) {
|
||||
struct mg_iobuf *io = (struct mg_iobuf *) param;
|
||||
if (io->len + 2 > io->size) mg_iobuf_resize(io, io->size + 64);
|
||||
if (io->len + 2 <= io->size) {
|
||||
@@ -75,7 +75,7 @@ void mg_putchar_iobuf(char ch, void *param) {
|
||||
|
||||
// We don't use realloc() in mongoose, so resort to inefficient calloc
|
||||
// Every new character reallocates the whole string
|
||||
void mg_putchar_realloc(char ch, void *param) {
|
||||
void mg_pfn_realloc(char ch, void *param) {
|
||||
char *s, *buf = *(char **) param;
|
||||
size_t len = buf == NULL ? 0 : strlen(buf);
|
||||
if ((s = (char *) calloc(1, len + 2)) != NULL) {
|
||||
|
||||
Reference in new issue
Block a user