src/server/webdav/webdav.c

changeset 88
73b3485e96f1
parent 87
bdec069d2239
child 91
fac51f87def0
equal deleted inserted replaced
87:bdec069d2239 88:73b3485e96f1
314 sbuf_t *out = sbuf_new(256); 314 sbuf_t *out = sbuf_new(256);
315 sbuf_puts(out, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); 315 sbuf_puts(out, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
316 sbuf_puts(out, "<D:multistatus"); 316 sbuf_puts(out, "<D:multistatus");
317 UcxMapIterator nsiter = ucx_map_iterator(davrq->nsmap->map); 317 UcxMapIterator nsiter = ucx_map_iterator(davrq->nsmap->map);
318 XmlNs *ns; 318 XmlNs *ns;
319 UCX_MAP_FOREACH(ns, nsiter) { 319 UCX_MAP_FOREACH(key, ns, nsiter) {
320 sbuf_puts(out, " xmlns:"); 320 sbuf_puts(out, " xmlns:");
321 sbuf_puts(out, ns->prefix); 321 sbuf_puts(out, ns->prefix);
322 sbuf_puts(out, "=\""); 322 sbuf_puts(out, "=\"");
323 sbuf_puts(out, ns->xmlns); 323 sbuf_puts(out, ns->xmlns);
324 sbuf_puts(out, "\""); 324 sbuf_puts(out, "\"");
420 sbuf_puts(davrq->out, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); 420 sbuf_puts(davrq->out, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
421 //sbuf_puts(davrq->out, "<D:multistatus xmlns:D=\"DAV:\">\n"); 421 //sbuf_puts(davrq->out, "<D:multistatus xmlns:D=\"DAV:\">\n");
422 sbuf_puts(davrq->out, "<D:multistatus"); 422 sbuf_puts(davrq->out, "<D:multistatus");
423 UcxMapIterator nsiter = ucx_map_iterator(davrq->nsmap->map); 423 UcxMapIterator nsiter = ucx_map_iterator(davrq->nsmap->map);
424 XmlNs *ns; 424 XmlNs *ns;
425 UCX_MAP_FOREACH(ns, nsiter) { 425 UCX_MAP_FOREACH(key, ns, nsiter) {
426 sbuf_puts(davrq->out, " xmlns:"); 426 sbuf_puts(davrq->out, " xmlns:");
427 sbuf_puts(davrq->out, ns->prefix); 427 sbuf_puts(davrq->out, ns->prefix);
428 sbuf_puts(davrq->out, "=\""); 428 sbuf_puts(davrq->out, "=\"");
429 sbuf_puts(davrq->out, ns->xmlns); 429 sbuf_puts(davrq->out, ns->xmlns);
430 sbuf_puts(davrq->out, "\""); 430 sbuf_puts(davrq->out, "\"");
789 sbuf_puts(out, "</D:propstat>\n"); 789 sbuf_puts(out, "</D:propstat>\n");
790 } 790 }
791 791
792 UcxMapIterator iter = ucx_map_iterator(propstat->map); 792 UcxMapIterator iter = ucx_map_iterator(propstat->map);
793 UcxDlist *proplist; 793 UcxDlist *proplist;
794 UCX_MAP_FOREACH(proplist, iter) { 794 UCX_MAP_FOREACH(key, proplist, iter) {
795 if(proplist) { 795 if(proplist) {
796 sbuf_puts(out, "<D:propstat>\n<D:prop>\n"); 796 sbuf_puts(out, "<D:propstat>\n<D:prop>\n");
797 797
798 DAV_FOREACH(prop, proplist) { 798 DAV_FOREACH(prop, proplist) {
799 xmlelm_write((XmlElement*)prop->data, out, wv); 799 xmlelm_write((XmlElement*)prop->data, out, wv);

mercurial