Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/navi2ch-list.el b/navi2ch-list.el
- index 4188735..a2e8cad 100644
- --- a/navi2ch-list.el
- +++ b/navi2ch-list.el
- @@ -567,7 +567,7 @@ changed-list は '((board-id old-board new-board) ...) な alist。
- (let ((board-id (cdr (assoc url navi2ch-list-board-id-alist))))
- (or board-id
- (save-match-data
- - (if (string-match "\\`http://.+/\\([^/]+\\)/\\'" url)
- + (if (string-match "\\`https?://.+/\\([^/]+\\)/\\'" url)
- (match-string 1 url))))))
- (defun navi2ch-list-make-board-txt ()
- @@ -590,7 +590,7 @@ changed-list は '((board-id old-board new-board) ...) な alist。
- (if (string-match "a" tag)
- (let (url board-id id u)
- (when (and (not ignore)
- - (string-match "href=\\(.+/\\([^/]+\\)/\\)" attr))
- + (string-match "href=\"?\\(.+/\\([^/]+\\)/\\)" attr))
- (setq url (match-string 1 attr))
- (setq url (or (cdr (assoc
- url
- @@ -624,7 +624,7 @@ changed-list は '((board-id old-board new-board) ...) な alist。
- (defun navi2ch-list-valid-board (uri)
- (save-match-data
- - (when (string-match "http://\\([^/]+\\)/\\([^/]+\\)/" uri)
- + (when (string-match "https?://\\([^/]+\\)/\\([^/]+\\)/" uri)
- (let ((host (match-string 1 uri)))
- (and (not (string-match navi2ch-list-invalid-host-regexp host))
- (string-match navi2ch-list-valid-host-regexp host))))))
- diff --git a/navi2ch-multibbs.el b/navi2ch-multibbs.el
- index 8e49f28..d1ef831 100644
- --- a/navi2ch-multibbs.el
- +++ b/navi2ch-multibbs.el
- @@ -345,7 +345,7 @@ START, END, NOFIRST で範囲を指定する"
- ;;;-----------------------------------------------
- -(defsubst navi2ch-2ch-subject-callback ()
- +(defsubst navi2ch-2ch-subject-callback (&optional args)
- (when navi2ch-board-use-subback-html
- (navi2ch-board-make-subject-txt)))
- @@ -525,7 +525,7 @@ START, END, NOFIRST で範囲を指定する"
- 'equal)))
- (navi2ch-cache-get
- (cons uri file-name)
- - (cond ((string-match "http://\\(?:[^@/]+@\\)?\\(.+\\)" uri)
- + (cond ((string-match "https?://\\(?:[^@/]+@\\)?\\(.+\\)" uri)
- (navi2ch-expand-file-name
- (concat (match-string 1 uri)
- file-name)))
- diff --git a/navi2ch-net.el b/navi2ch-net.el
- index dc11ec5..972c97f 100644
- --- a/navi2ch-net.el
- +++ b/navi2ch-net.el
- @@ -228,7 +228,8 @@ nil なら常に再接続する。")
- host (cdr (assq 'host list))
- file (cdr (assq 'file list))
- port (cdr (assq 'port list))
- - host2ch (cdr (assq 'host2ch list))))
- + host2ch (cdr (assq 'host2ch list))
- + rest (cdr (assq 'rest list))))
- (when navi2ch-net-http-proxy
- (setq credentials (navi2ch-net-http-basic-credentials
- navi2ch-net-http-proxy-userid
- @@ -257,11 +258,8 @@ nil なら常に再接続する。")
- (setq proc nil)
- (unless (navi2ch-net-down-p host)
- (condition-case nil
- - (if (string-match "^https://" url)
- - (setq proc (funcall 'open-tls-stream
- - navi2ch-net-connection-name buf host "443"))
- - (setq proc (funcall navi2ch-open-network-stream-function
- - navi2ch-net-connection-name buf host port)))
- + (setq proc (apply navi2ch-open-network-stream-function
- + navi2ch-net-connection-name buf host port rest))
- (error (navi2ch-net-add-down-host host)))))
- (when proc
- (with-current-buffer buf
- @@ -304,6 +302,10 @@ nil なら常に再接続する。")
- (navi2ch-net-cleanup-vars)
- (setq navi2ch-net-process proc))))
- +(defun navi2ch-net-split-url-scheme-to-rest (scheme)
- + (if (string-prefix-p "https:" scheme)
- + '(:type tls)))
- +
- (defun navi2ch-net-split-url (url &optional proxy)
- (let (host2ch authinfo user pass)
- (string-match "https?://\\([^@/]+@\\)?\\([^/]+\\)" url)
- @@ -324,16 +326,21 @@ nil なら常に再接続する。")
- (cons 'host (match-string 2 proxy))
- (cons 'file url)
- (cons 'port (string-to-number (match-string 3 proxy)))
- - (cons 'host2ch host2ch)))
- - (string-match "https?://\\(?:[^@/]+@\\)?\\([^/:]+\\)\\(?::\\([0-9]+\\)\\)?\\(.*\\)" url)
- + (cons 'host2ch host2ch)
- + (cons 'rest (navi2ch-net-split-url-scheme-to-rest (match-string 1 proxy)))))
- + (string-match "\\(https?://\\)\\(?:[^@/]+@\\)?\\([^/:]+\\)\\(?::\\([0-9]+\\)\\)?\\(.*\\)" url)
- (list
- (cons 'user user)
- (cons 'pass pass)
- - (cons 'host (match-string 1 url))
- - (cons 'port (string-to-number (or (match-string 2 url)
- - "80")))
- - (cons 'file (match-string 3 url))
- - (cons 'host2ch host2ch)))))
- + (cons 'host (match-string 2 url))
- + (cons 'port
- + (if (match-string 3 url)
- + (string-to-number (match-string 3 url))
- + (if (string-prefix-p "https:" (match-string 1 url))
- + 443 80)))
- + (cons 'file (match-string 4 url))
- + (cons 'host2ch host2ch)
- + (cons 'rest (navi2ch-net-split-url-scheme-to-rest (match-string 1 url)))))))
- (defun navi2ch-net-http-basic-credentials (user pass)
- "USER と PASS から Basic 認証の証明書 (?) 部分を返す。"
- @@ -999,7 +1006,7 @@ This is taken from RFC 2396.")
- "BBS_\\(TITLE_PICTURE\\|FIGUREHEAD\\)=\\(.+\\)" content))
- (setq src (match-string 2 content))
- (let (url file)
- - (setq url (if (string-match "http://" src)
- + (setq url (if (string-match "https?://" src)
- src
- (navi2ch-board-get-url board src)))
- (string-match "/\\([^/]+\\)$" url)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement