diff options
Diffstat (limited to 'server/src/server.cc')
-rw-r--r-- | server/src/server.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/server/src/server.cc b/server/src/server.cc index c88de4d..2a4c882 100644 --- a/server/src/server.cc +++ b/server/src/server.cc @@ -57,10 +57,15 @@ static void send_macro_widget(Widget &widget, TCPSocket &socket, std::string tab socket.write(tabs + "<" + widget.type); WidgetPropertyList::iterator p = widget.properties.begin(); while(p != widget.properties.end()) { - WidgetProperty &property = *p; - socket.write(" " + property.name + "=\"" + property.value + "\""); + socket.write(" " + p->first + "=\"" + p->second + "\""); p++; } + + if(widget.widgets.size() == 0) { // If node is empty, use short tag form + socket.write("/>\n"); + return; + } + socket.write(">\n"); WidgetList::iterator w = widget.widgets.begin(); @@ -91,11 +96,14 @@ static void connection(TCPSocket &socket) Macro macro; parse_macro(request.macro, macro); + socket.write(" <macro version=\"" + macro.version + "\" name=\"" + + macro.name + "\" resume=\"" + macro.format + "\">\n"); WidgetList::iterator w = macro.widgets.begin(); while(w != macro.widgets.end()) { - send_macro_widget(*w, socket, " "); + send_macro_widget(*w, socket, " "); w++; } + socket.write(" </macro>\n"); printf("done.\n"); @@ -125,8 +133,6 @@ static void connection(TCPSocket &socket) journal_commit_addr.c_str(), journal_commit_port, resume.c_str(), resume.length()); - // printf(resume.c_str()); - i++; } } |