You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by dc...@apache.org on 2013/05/14 23:34:49 UTC

git commit: updated refs/heads/master to 73db817

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 <dc...@apache.org>
Authored: Fri Apr 26 22:08:34 2013 +0000
Committer: Dave Cottlehuber <dc...@apache.org>
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()}].