Skip to content

Commit

Permalink
Use a relative path to specify the temporary cert file for `curl'.
Browse files Browse the repository at this point in the history
* twittering-mode.el: Use a relative path to specify the temporary
cert file for `curl' to ignore the difference of path
representation between Windows and Cygwin.
(twittering-start-http-session-curl): change directory before
invoking `curl' and specify the temporary cert file with relative
path.
  • Loading branch information
cvmat committed May 17, 2010
1 parent d1feeb4 commit 4aea9ec
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ChangeLog
Expand Up @@ -3,6 +3,13 @@
* twittering-mode.el (twittering-start-http-session-curl): fix
extraction of the scheme from the variable `request'.

* twittering-mode.el: Use a relative path to specify the temporary
cert file for `curl' to ignore the difference of path
representation between Windows and Cygwin.
(twittering-start-http-session-curl): change directory before
invoking `curl' and specify the temporary cert file with relative
path.

2010-05-15 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el: Add copyright of the ACTIVE/INACTIVE
Expand Down
19 changes: 18 additions & 1 deletion twittering-mode.el
Expand Up @@ -2848,6 +2848,23 @@ Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv
(headers (if (assoc "Expect" headers)
headers
(cons '("Expect" . "") headers)))
(cacert-fullpath (when twittering-use-ssl
(twittering-ensure-ca-cert)))
(cacert-dir (when cacert-fullpath
(file-name-directory cacert-fullpath)))
(cacert-filename (when cacert-fullpath
(file-name-nondirectory cacert-fullpath)))
(default-directory
;; If `twittering-use-ssl' is non-nil, the `curl' process
;; is executed at the same directory as the temporary cert file.
;; Without changing directory, `curl' misses the cert file if
;; you use Emacs on Cygwin because the path on Emacs differs
;; from Windows.
;; With changing directory, `curl' on Windows can find the cert
;; file if you use Emacs on Cygwin.
(if twittering-use-ssl
cacert-dir
default-directory))
(curl-args
`("--include" "--silent"
,@(mapcan (lambda (pair)
Expand All @@ -2859,7 +2876,7 @@ Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv
`("-H" ,(format "%s: %s" (car pair) (cdr pair)))))
headers)
,@(when twittering-use-ssl
`("--cacert" ,(twittering-ensure-ca-cert)))
`("--cacert" ,cacert-filename))
,@(when twittering-proxy-use
(let* ((proxy-info
(twittering-proxy-info (funcall request :schema)))
Expand Down

0 comments on commit 4aea9ec

Please sign in to comment.