Changeset 15023 in project for release/4/intarweb/trunk/intarweb.scm


Ignore:
Timestamp:
06/18/09 22:46:45 (11 years ago)
Author:
sjamaan
Message:

Add response-class procedure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/intarweb/trunk/intarweb.scm

    r14979 r15023  
    3939   headers? headers->list http-name->symbol symbol->http-name
    4040   header-parsers header-unparsers unparse-header unparse-headers
    41    safe-methods safe? idempotent-methods idempotent? keep-alive?
     41   safe-methods safe? idempotent-methods idempotent? keep-alive? response-class
    4242   
    4343   make-request request? request-major request-major-set!
     
    265265       ;; RFC 2068, section 19.7.1 (see also RFC 2616, section 19.6.2)
    266266       (eq? con 'keep-alive))))
     267
     268(define (response-class obj)
     269  (let ((code (if (response? obj) (response-code obj) obj)))
     270    (- code (modulo code 100))))
    267271
    268272;;;;;;;;;;;;;;;;;;;;;;;;;
Note: See TracChangeset for help on using the changeset viewer.