headers))
(reverse headers))))
+
;; Spartan page retrieval
(defvar elpher-spartan-redirect-chain)
(insert content)
(elpher-restore-pos))
(elpher-with-clean-buffer
- (insert "LOADING GEMINI... (use 'u' to cancel)\n"))
+ (insert "LOADING SPARTAN... (use 'u' to cancel)\n"))
(setq elpher-spartan-redirect-chain nil)
(elpher-get-spartan-response address renderer))
(error
(error "Malformed response: No CRLF-delimited header found in response %s" response))))
(defun elpher-process-spartan-response (response-string renderer)
- "Process the gemini response RESPONSE-STRING and pass the result to RENDERER."
- (let ((response-components (elpher-parse-gemini-response response-string)))
+ "Process the spartan response RESPONSE-STRING and pass the result to RENDERER."
+ (let ((response-components (elpher-parse-spartan-response response-string)))
(let ((response-code (elt response-components 0))
(response-meta (elt response-components 1))
(response-body (elt response-components 2)))
(message "Following redirect to %s" response-meta)
(if (>= (length elpher-spartan-redirect-chain) 5)
(error "More than 5 consecutive redirects followed"))
- (let* ((current-address (elpher-page-address current-page))
+ (let* ((current-address (elpher-page-address elpher-current-page))
(redirect-address (elpher-address-from-url
(concat "spartan://"
(elpher-address-host current-address)
(elpher-page-set-address elpher-current-page redirect-address)
(add-to-list 'elpher-gemini-redirect-chain redirect-address)
(elpher-get-spartan-response redirect-address renderer)))
- (?4 ; Temporary failure
+ (?4 ; Client error
(error "Spartan server reports CLIENT ERROR for this request: %s %s"
response-code response-meta))
- (?5 ; Permanent failure
+ (?5 ; Server error
(error "Spartan server reports SERVER ERROR for this request: %s %s"
response-code response-meta))
(_other