Changeset 15836 in project


Ignore:
Timestamp:
09/12/09 17:08:19 (10 years ago)
Author:
sjamaan
Message:

We don't really need clean-attributes, we only need to remove @digest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/estraier-client/estraier-client.scm

    r15835 r15836  
    4646   
    4747   ;; these could be useful on their own, so export them too
    48    clean-attributes read-attributes read-draft write-attributes write-draft
     48   read-attributes read-draft write-attributes write-draft
    4949
    5050   master-shutdown master-sync master-backup master-rotate-log
     
    134134               (read-lines in)))))
    135135
    136 ;; If control commands or the @digest attribute are sent back when
    137 ;; updating a document, the node will silently ignore the document...
    138 (define (clean-attributes attributes)
    139   (filter (lambda (attrib)
    140             (and (not (string-prefix? "#" (->string (car attrib))))
    141                  (not (eq? (car attrib) '@digest))))
    142           attributes))
    143 
    144136(define (write-attributes outport attributes)
    145137  (for-each (lambda (attrib)
     
    173165                 headers: (headers '((content-type text/x-estraier-draft))))
    174166   (call-with-output-string ; use string because it wants content-length
    175      (lambda (out) (write-draft out (clean-attributes attribs) contents)))
     167     ;; Can't write @digest because that would invalidate the document
     168     (lambda (out) (write-draft out (alist-delete '@digest attribs) contents)))
    176169   discard-output))
    177170
     
    200193                 headers: (headers '((content-type text/x-estraier-draft))))
    201194   (call-with-output-string ; use string because it wants content-length
    202      (lambda (out) (write-attributes out (clean-attributes attribs))))
     195     ;; Can't write @digest because that would invalidate the document
     196     (lambda (out) (write-attributes out (alist-delete '@digest attribs))))
    203197   discard-output))
    204198
Note: See TracChangeset for help on using the changeset viewer.