projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2d5504a
)
better logging presentation of chardata
author
Art Cancro
<ajc@citadel.org>
Sun, 11 Feb 2024 05:47:21 +0000
(
00:47
-0500)
committer
Art Cancro
<ajc@citadel.org>
Sun, 11 Feb 2024 05:47:21 +0000
(
00:47
-0500)
webcit-ng/server/caldav_reports.c
patch
|
blob
|
history
diff --git
a/webcit-ng/server/caldav_reports.c
b/webcit-ng/server/caldav_reports.c
index e6a13cef009f3e0eaff57442ea878221d6ff9433..e2a4e081f214390f872a81283d02c3d70010f529 100644
(file)
--- a/
webcit-ng/server/caldav_reports.c
+++ b/
webcit-ng/server/caldav_reports.c
@@
-34,7
+34,7
@@
void caldav_xml_start(void *data, const char *el, const char **attr) {
char indent[256];
indent[0] = 0;
for (i=0; i<crp->tag_nesting_level; ++i) {
char indent[256];
indent[0] = 0;
for (i=0; i<crp->tag_nesting_level; ++i) {
- strcat(indent, "
");
+ strcat(indent, "
··
");
}
syslog(LOG_DEBUG, "%s<%s>", indent, el);
for (i = 0; attr[i] != NULL; i += 2) {
}
syslog(LOG_DEBUG, "%s<%s>", indent, el);
for (i = 0; attr[i] != NULL; i += 2) {
@@
-74,10
+74,7
@@
void caldav_xml_end(void *data, const char *el) {
char indent[256];
indent[0] = 0;
for (i=0; i<crp->tag_nesting_level; ++i) {
char indent[256];
indent[0] = 0;
for (i=0; i<crp->tag_nesting_level; ++i) {
- strcat(indent, " ");
- }
- if (crp->Chardata != NULL) {
- syslog(LOG_DEBUG, "%sCHARDATA: '%s'", indent, ChrPtr(crp->Chardata));
+ strcat(indent, "··");
}
syslog(LOG_DEBUG, "%s</%s>", indent, el);
// end logging
}
syslog(LOG_DEBUG, "%s</%s>", indent, el);
// end logging
@@
-101,14
+98,36
@@
void caldav_xml_end(void *data, const char *el) {
// XML parser callback
// XML parser callback
-void caldav_xml_chardata(void *data, const XML_Char *
s, int len) {
+void caldav_xml_chardata(void *data, const XML_Char *s, int len) {
struct cr_parms *crp = (struct cr_parms *) data;
struct cr_parms *crp = (struct cr_parms *) data;
+ char *app = malloc(len+1);
+ if (!app) {
+ return;
+ }
+ memcpy(app, s, len);
+ app[len] = 0;
+
+#ifdef DEBUG_XML_PARSE
+ // logging
+ int i;
+ char indent[256];
+ indent[0] = 0;
+ for (i=0; i<crp->tag_nesting_level; ++i) {
+ strcat(indent, "··");
+ }
+ syslog(LOG_DEBUG, "%s%s", indent, app);
+ // end logging
+#endif
+
+
if (crp->Chardata == NULL) {
crp->Chardata = NewStrBuf();
}
if (crp->Chardata == NULL) {
crp->Chardata = NewStrBuf();
}
- StrBufAppendBufPlain(crp->Chardata, s, len, 0);
+ //StrBufAppendBufPlain(crp->Chardata, s, len, 0);
+ StrBufAppendBufPlain(crp->Chardata, app, len, 0);
+ free(app);
return;
}
return;
}