Show
Ignore:
Timestamp:
09/13/09 14:43:17 (9 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1252852997 +0000
git-parent:

[57a2287f4d549439df74e04e133e5a4e40582d97]

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

work on #171, getting check info works

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_http.c

    r6688159 r0256945  
    3939#include <assert.h> 
    4040#include <zlib.h> 
     41#include <libxml/tree.h> 
    4142 
    4243#define REQ_PAT "\r\n\r\n" 
     
    562563                        struct timeval *now) { 
    563564  noit_http_session_ctx *ctx = closure; 
    564   int rv
     565  int rv = 0
    565566  int mask = origmask; 
    566567 
     
    833834                                struct bchain *in) { 
    834835  struct bchain *out; 
    835   int ilen, maxlen, hexlen; 
     836  int ilen, maxlen = in->size, hexlen; 
    836837  int opts = ctx->res.output_options; 
    837838 
     
    945946  return noit_true; 
    946947} 
     948 
     949 
     950/* Helper functions */ 
     951 
     952static int 
     953noit_http_write_xml(void *vctx, const char *buffer, int len) { 
     954  if(noit_http_response_append((noit_http_session_ctx *)vctx, buffer, len)) 
     955    return len; 
     956  return -1; 
     957} 
     958static int 
     959noit_http_close_xml(void *vctx) { 
     960  noit_http_response_end((noit_http_session_ctx *)vctx); 
     961  return 0; 
     962} 
     963void 
     964noit_http_response_xml(noit_http_session_ctx *ctx, xmlDocPtr doc) { 
     965  xmlOutputBufferPtr out; 
     966  xmlCharEncodingHandlerPtr enc; 
     967  enc = xmlGetCharEncodingHandler(XML_CHAR_ENCODING_UTF8); 
     968  out = xmlOutputBufferCreateIO(noit_http_write_xml, 
     969                                noit_http_close_xml, 
     970                                ctx, enc); 
     971  xmlSaveFormatFileTo(out, doc, "utf8", 1); 
     972} 
     973