Changeset ea6ba4161f18ddc6b87d887e6bda5c05ae18ceef

Show
Ignore:
Timestamp:
05/15/09 02:42:40 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1242355360 +0000
git-parent:

[f5e593b3a2875895dd7e3f4489b4435f7712c831]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1242355360 +0000
Message:

fixes #123

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/Makefile.in

    ra907717 rea6ba41  
    3939        noit_check.o noit_check_log.o noit_check_tools.o \ 
    4040        noit_module.o noit_conf.o noit_conf_checks.o noit_tokenizer.o \ 
    41         noit_capabilities_listener.o
     41        noit_capabilities_listener.o noit_xml.o
    4242        noit_jlog_listener.o noit_livestream_listener.o noit_filters.o 
    4343 
    4444STRATCON_OBJS=stratcond.o noit_listener.o \ 
    4545        noit_console.o noit_console_state.o noit_console_telnet.o \ 
    46         noit_console_complete.o
     46        noit_console_complete.o noit_xml.o
    4747        noit_conf.o noit_http.o noit_tokenizer.o \ 
    4848        stratcon_realtime_http.o \ 
  • src/noit_capabilities_listener.c

    r88a7178 rea6ba41  
    4040#include "noit_module.h" 
    4141#include "noit_check.h" 
     42#include "noit_xml.h" 
    4243 
    4344#include <unistd.h> 
     
    9394    xmlDocPtr xmldoc; 
    9495    xmlNodePtr root, cmds; 
    95     xmlBufferPtr xmlbuffer; 
    96     xmlSaveCtxtPtr savectx; 
    9796 
    9897    cl = ac->service_ctx = calloc(1, sizeof(*cl)); 
     
    150149 
    151150    /* Write it out to a buffer and copy it for writing */ 
    152     xmlbuffer = xmlBufferCreate(); 
    153     savectx = xmlSaveToBuffer(xmlbuffer, "utf8", 1); 
    154     xmlSaveDoc(savectx, xmldoc); 
    155     xmlSaveClose(savectx); 
    156     cl->buff = strdup((const char *)xmlBufferContent(xmlbuffer)); 
    157     cl->towrite = xmlBufferLength(xmlbuffer); 
     151    cl->buff = noit_xmlSaveToBuffer(xmldoc); 
     152    cl->towrite = strlen(cl->buff); 
    158153 
    159154    /* Clean up after ourselves */ 
    160     xmlBufferFree(xmlbuffer); 
    161155    xmlFreeDoc(xmldoc); 
    162156  } 
  • src/stratcon_iep.c

    r88a7178 rea6ba41  
    4141#include "noit_conf.h" 
    4242#include "noit_check.h" 
     43#include "noit_xml.h" 
    4344 
    4445#include <unistd.h> 
     
    265266    free(line); 
    266267  } 
    267 } 
    268  
    269 static char * 
    270 stratcon__xml_doc_to_str(xmlDocPtr doc) { 
    271   char *rv; 
    272   xmlSaveCtxtPtr savectx; 
    273   xmlBufferPtr xmlbuffer; 
    274   xmlbuffer = xmlBufferCreate(); 
    275   savectx = xmlSaveToBuffer(xmlbuffer, "utf8", 1); 
    276   xmlSaveDoc(savectx, doc); 
    277   xmlSaveClose(savectx); 
    278   rv = strdup((const char *)xmlBufferContent(xmlbuffer)); 
    279   xmlBufferFree(xmlbuffer); 
    280   return rv; 
    281268} 
    282269 
     
    383370  job->doc = stratcon_iep_doc_from_line(job->line, job->remote); 
    384371  if(job->doc) { 
    385     job->doc_str = stratcon__xml_doc_to_str(job->doc); 
     372    job->doc_str = noit_xmlSaveToBuffer(job->doc); 
    386373    if(job->doc_str) { 
    387374      /* Submit */