[haiku-commits] haiku: hrev46708 - in src: add-ons/accelerants/intel_extreme kits/network/libnetapi

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 19 Jan 2014 12:10:44 +0100 (CET)

hrev46708 adds 3 changesets to branch 'master'
old head: 8540ec2446d1fda22904ace548570b73d91f4726
new head: 8efd9b8d00411409dd8a2f2447a6f84fc727e5d9
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=8efd9b8+%5E8540ec2

----------------------------------------------------------------------------

32da3d9: Cookies: avoid timezone confusion
  
  Cookies date are always in GMT time. Using mktime wrongly converts them
  as local time instead. This would lead to cookies expiring too early or
  too late.

7e433e7: FileRequest: set the mime type early.
  
  WebKit may use the MIME type during incremental loading, so we better
  set it before we start feeding the data.

8efd9b8: Remove display_mode_hook hack.
  
  We'd better find a cleaner way to implement this, if actually needed.

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

3 files changed, 11 insertions(+), 32 deletions(-)
src/add-ons/accelerants/intel_extreme/mode.cpp | 27 +---------------------
src/kits/network/libnetapi/FileRequest.cpp     | 10 ++++----
src/kits/network/libnetapi/HttpTime.cpp        |  6 ++++-

############################################################################

Commit:      32da3d9dae5d1a54cdb49ce26ad7051f6494c2bc
URL:         http://cgit.haiku-os.org/haiku/commit/?id=32da3d9
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Sun Jan 19 11:01:36 2014 UTC

Cookies: avoid timezone confusion

Cookies date are always in GMT time. Using mktime wrongly converts them
as local time instead. This would lead to cookies expiring too early or
too late.

----------------------------------------------------------------------------

diff --git a/src/kits/network/libnetapi/HttpTime.cpp 
b/src/kits/network/libnetapi/HttpTime.cpp
index b963f95..ecc9c15 100644
--- a/src/kits/network/libnetapi/HttpTime.cpp
+++ b/src/kits/network/libnetapi/HttpTime.cpp
@@ -107,7 +107,11 @@ BHttpTime::Parse()
 // TODO: The above was used initially. See http://en.wikipedia.org/wiki/Time.h
 // stippi: I don't know how Christophe had this code compiling initially,
 // since Haiku does not appear to implement timegm().
-return mktime(&expireTime);
+// Using mktime() doesn't cut it, as cookies set with a date shortly in the
+// future (eg. 1 hour) would expire immediately.
+       time_t t = mktime(&expireTime);
+       t -= mktime(gmtime(&t)) - (int)mktime(localtime(&t));
+       return t;
 }
 
 

############################################################################

Commit:      7e433e7cada4b8b1665a3a0f0dcc225be74cdf20
URL:         http://cgit.haiku-os.org/haiku/commit/?id=7e433e7
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Sun Jan 19 11:03:01 2014 UTC

FileRequest: set the mime type early.

WebKit may use the MIME type during incremental loading, so we better
set it before we start feeding the data.

----------------------------------------------------------------------------

diff --git a/src/kits/network/libnetapi/FileRequest.cpp 
b/src/kits/network/libnetapi/FileRequest.cpp
index 4a3b05c..326b1c7 100644
--- a/src/kits/network/libnetapi/FileRequest.cpp
+++ b/src/kits/network/libnetapi/FileRequest.cpp
@@ -57,6 +57,11 @@ BFileRequest::_ProtocolLoop()
                if (error != B_OK)
                        return error;
 
+               BNodeInfo info(&file);
+               char mimeType[B_MIME_TYPE_LENGTH + 1];
+               if (info.GetType(mimeType) == B_OK)
+                       fResult.SetContentType(mimeType);
+
                // Send all notifications to listener, if any
                if (fListener != NULL) {
                        fListener->ConnectionOpened(this);
@@ -77,11 +82,6 @@ BFileRequest::_ProtocolLoop()
                        fListener->DownloadProgress(this, size, size);
                }
 
-               BNodeInfo info(&file);
-               char mimeType[B_MIME_TYPE_LENGTH + 1];
-               if (info.GetType(mimeType) == B_OK)
-                       fResult.SetContentType(mimeType);
-
                return B_OK;
        }
 

############################################################################

Revision:    hrev46708
Commit:      8efd9b8d00411409dd8a2f2447a6f84fc727e5d9
URL:         http://cgit.haiku-os.org/haiku/commit/?id=8efd9b8
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Sun Jan 19 11:04:48 2014 UTC

Remove display_mode_hook hack.

We'd better find a cleaner way to implement this, if actually needed.

----------------------------------------------------------------------------

diff --git a/src/add-ons/accelerants/intel_extreme/mode.cpp 
b/src/add-ons/accelerants/intel_extreme/mode.cpp
index c68aea2..130a56c 100644
--- a/src/add-ons/accelerants/intel_extreme/mode.cpp
+++ b/src/add-ons/accelerants/intel_extreme/mode.cpp
@@ -74,17 +74,6 @@ struct pll_limits {
 };
 
 
-static struct display_mode_hook {
-       bool active;
-       display_mode *dm;
-       struct {
-               uint16 width;
-               uint16 height;
-               uint16 space;
-       } mode;
-} display_mode_hook;
-
-
 static void mode_fill_missing_bits(display_mode *, uint32);
 
 
@@ -650,11 +639,6 @@ create_mode_list(void)
                                                TRACE("intel_extreme: ignoring 
VBT mode.");
                                }
 
-                               // We can also make this the default 
resolution, if the user
-                               // didn't pick one yet.
-                               display_mode_hook.active = true;
-                               display_mode_hook.dm = list;
-
                                gInfo->mode_list_area = area;
                                gInfo->mode_list = list;
                                gInfo->shared_info->mode_list_area = 
gInfo->mode_list_area;
@@ -765,11 +749,6 @@ intel_propose_display_mode(display_mode* target, const 
display_mode* low,
 status_t
 intel_set_display_mode(display_mode* mode)
 {
-       if (display_mode_hook.active) {
-               mode = display_mode_hook.dm;
-               display_mode_hook.active = false;
-       }
-
        if (mode == NULL)
                return B_BAD_VALUE;
 
@@ -794,7 +773,7 @@ intel_set_display_mode(display_mode* mode)
        // place.
 
 #if 0
-static bool first = tru;
+static bool first = true;
 if (first) {
        int fd = open("/boot/home/ie_.regs", O_CREAT | O_WRONLY, 0644);
        if (fd >= 0) {
@@ -1227,10 +1206,6 @@ if (first) {
        sharedInfo.current_mode = target;
        sharedInfo.bits_per_pixel = bitsPerPixel;
 
-       display_mode_hook.mode.width = target.virtual_width;
-       display_mode_hook.mode.height = target.virtual_height;
-       display_mode_hook.mode.space = target.space;
-
        return B_OK;
 }
 


Other related posts:

  • » [haiku-commits] haiku: hrev46708 - in src: add-ons/accelerants/intel_extreme kits/network/libnetapi - pulkomandy