mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-28 05:39:00 +08:00
Update to new %M API
Doc still references the old API and mg_rprintf() is not yet documented
This commit is contained in:
parent
a4a340dbd4
commit
71eefb6272
@ -27,15 +27,14 @@ static long getparam(struct mg_http_message *hm, const char *json_path) {
|
||||
return dv;
|
||||
}
|
||||
|
||||
static size_t printdata(char *buf, size_t len, va_list *ap) {
|
||||
static size_t printdata(void (*out)(char, void *), void *ptr, va_list *ap) {
|
||||
unsigned start = va_arg(*ap, unsigned);
|
||||
unsigned max = start + CHUNK_SIZE;
|
||||
const char *comma = "";
|
||||
size_t n = 0;
|
||||
if (max > DATA_SIZE) max = DATA_SIZE;
|
||||
while (start < max) {
|
||||
n += mg_snprintf(buf ? buf + n : 0, len < n ? 0 : len - n, "%s%d", comma,
|
||||
s_data[start]);
|
||||
n += mg_rprintf(out, ptr, "%s%d", comma, s_data[start]);
|
||||
comma = ",";
|
||||
start++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user