Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2D18F9558 for ; Tue, 14 May 2013 21:34:50 +0000 (UTC) Received: (qmail 90290 invoked by uid 500); 14 May 2013 21:34:50 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 90146 invoked by uid 500); 14 May 2013 21:34:49 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 90135 invoked by uid 99); 14 May 2013 21:34:49 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 May 2013 21:34:49 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 51D0F8DCB; Tue, 14 May 2013 21:34:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dch@apache.org To: commits@couchdb.apache.org Message-Id: <113226c9dd85437caf83581a69c88998@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to 73db817 Date: Tue, 14 May 2013 21:34:49 +0000 (UTC) Updated Branches: refs/heads/master 94b402d94 -> 73db81793 COUCHDB-1696 really fix R14B04 support Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/73db8179 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/73db8179 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/73db8179 Branch: refs/heads/master Commit: 73db8179323c01bdd40eda2d587d52588f30a60f Parents: 94b402d Author: Dave Cottlehuber Authored: Fri Apr 26 22:08:34 2013 +0000 Committer: Dave Cottlehuber Committed: Tue May 14 23:34:09 2013 +0200 ---------------------------------------------------------------------- src/couchdb/couch_app.erl | 2 +- src/mochiweb/Makefile.am | 1 - src/mochiweb/mochiweb.app.in | 33 ++++--------------------------- src/mochiweb/mochiweb.app.src | 9 -------- src/mochiweb/mochiweb_request.erl | 21 +++++++++++++++++++- 5 files changed, 26 insertions(+), 40 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/73db8179/src/couchdb/couch_app.erl ---------------------------------------------------------------------- diff --git a/src/couchdb/couch_app.erl b/src/couchdb/couch_app.erl index f109780..24b2f3a 100644 --- a/src/couchdb/couch_app.erl +++ b/src/couchdb/couch_app.erl @@ -20,7 +20,7 @@ start(_Type, DefaultIniFiles) -> IniFiles = get_ini_files(DefaultIniFiles), - case start_apps([crypto, public_key, sasl, inets, oauth, ssl, ibrowse, mochiweb, os_mon]) of + case start_apps([crypto, public_key, sasl, inets, oauth, ssl, ibrowse, syntax_tools, compiler, xmerl, mochiweb, os_mon]) of ok -> couch_server_sup:start_link(IniFiles); {error, Reason} -> http://git-wip-us.apache.org/repos/asf/couchdb/blob/73db8179/src/mochiweb/Makefile.am ---------------------------------------------------------------------- diff --git a/src/mochiweb/Makefile.am b/src/mochiweb/Makefile.am index d31a6eb..90c0533 100644 --- a/src/mochiweb/Makefile.am +++ b/src/mochiweb/Makefile.am @@ -30,7 +30,6 @@ mochiweb_file_collection = \ mochitemp.erl \ mochiutf8.erl \ mochiweb.app.in \ - mochiweb.app.src \ mochiweb.erl \ mochiweb_acceptor.erl \ mochiweb_app.erl \ http://git-wip-us.apache.org/repos/asf/couchdb/blob/73db8179/src/mochiweb/mochiweb.app.in ---------------------------------------------------------------------- diff --git a/src/mochiweb/mochiweb.app.in b/src/mochiweb/mochiweb.app.in index 6a4a314..baced90 100644 --- a/src/mochiweb/mochiweb.app.in +++ b/src/mochiweb/mochiweb.app.in @@ -1,32 +1,9 @@ +%% This is generated from src/mochiweb.app.src {application, mochiweb, [{description, "MochiMedia Web Server"}, - {vsn, "1.4.1"}, - {modules, [ - mochihex, - mochijson, - mochijson2, - mochinum, - mochiweb, - mochiweb_app, - mochiweb_charref, - mochiweb_cookies, - mochiweb_echo, - mochiweb_headers, - mochiweb_html, - mochiweb_http, - mochiweb_multipart, - mochiweb_request, - mochiweb_response, - mochiweb_skel, - mochiweb_socket_server, - mochiweb_sup, - mochiweb_util, - reloader, - mochifmt, - mochifmt_std, - mochifmt_records - ]}, + {vsn, "2.4.2"}, + {modules, []}, {registered, []}, - {mod, {mochiweb_app, []}}, {env, []}, - {applications, [kernel, stdlib]}]}. + {applications, [kernel, stdlib, crypto, inets, ssl, xmerl, + compiler, syntax_tools]}]}. http://git-wip-us.apache.org/repos/asf/couchdb/blob/73db8179/src/mochiweb/mochiweb.app.src ---------------------------------------------------------------------- diff --git a/src/mochiweb/mochiweb.app.src b/src/mochiweb/mochiweb.app.src deleted file mode 100644 index baced90..0000000 --- a/src/mochiweb/mochiweb.app.src +++ /dev/null @@ -1,9 +0,0 @@ -%% This is generated from src/mochiweb.app.src -{application, mochiweb, - [{description, "MochiMedia Web Server"}, - {vsn, "2.4.2"}, - {modules, []}, - {registered, []}, - {env, []}, - {applications, [kernel, stdlib, crypto, inets, ssl, xmerl, - compiler, syntax_tools]}]}. http://git-wip-us.apache.org/repos/asf/couchdb/blob/73db8179/src/mochiweb/mochiweb_request.erl ---------------------------------------------------------------------- diff --git a/src/mochiweb/mochiweb_request.erl b/src/mochiweb/mochiweb_request.erl index 2727fc7..267bcd8 100644 --- a/src/mochiweb/mochiweb_request.erl +++ b/src/mochiweb/mochiweb_request.erl @@ -621,7 +621,7 @@ maybe_redirect(RelPath, FullPath, ExtraHeaders, end. maybe_serve_file(File, ExtraHeaders, {?MODULE, [_Socket, _Method, _RawPath, _Version, _Headers]}=THIS) -> - case file:read_file_info(File, [{time, universal}]) of + case read_file_info(File) of {ok, FileInfo} -> LastModified = couch_util:rfc1123_date(FileInfo#file_info.mtime), case get_header_value("if-modified-since", THIS) of @@ -645,6 +645,25 @@ maybe_serve_file(File, ExtraHeaders, {?MODULE, [_Socket, _Method, _RawPath, _Ver not_found(ExtraHeaders, THIS) end. +read_file_info(File) -> + try + file:read_file_info(File, [{time, universal}]) + catch error:undef -> + case file:read_file_info(File) of + {ok, FileInfo} -> + {ok, FileInfo#file_info{ + atime=to_universal(FileInfo#file_info.atime), + mtime=to_universal(FileInfo#file_info.mtime), + ctime=to_universal(FileInfo#file_info.ctime) + }}; + Else -> + Else + end + end. + +to_universal(LocalTime) -> + calendar:local_time_to_universal_time(LocalTime). + server_headers() -> [{"Server", "MochiWeb/1.0 (" ++ ?QUIP ++ ")"}, {"Date", couch_util:rfc1123_date()}].