[haiku-commits] haiku: hrev46664 - src/kits/network/libnetapi build/jam headers/os/net

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 13 Jan 2014 09:07:17 +0100 (CET)

hrev46664 adds 6 changesets to branch 'master'
old head: a6c0fea79c170d7ac8a68d95f9a63eacdb1710d3
new head: b3cc244542c94f4bf285caaa94efc7a67ad14248
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=b3cc244+%5Ea6c0fea

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

5e9a961: FileRequest: style fixes
  
  Pointed out by axeld, stippi and waddlesplash. Thanks for watching.

3d864cd: Remove B_PROT_* and related code
  
  Use standard error codes instead.
  This allows using error code returned by the underlying functions
  directly, and makes it possible to use strerror for debugging. So, we
  can also remove StatusString() from the various *Request classes.

121a158: Lua: update to bugfixed package
  
  The previous version didn't work at all.

024e81a: Update UserBuildConfig readme and sample
  
  AddOptionalHaikuImagePackage is replaced with AddHaikuImagePackages.

aa5101c: Update HaikuWebKit package to version 1.2.3.
  
  Older versions will not work anymore because of the API changes in
  network kit (removal of nonstandard B_PROT_* status codes). x86 and
  x86_64 packages have to be updated again.

b3cc244: Simplify cookie string-ification code.

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

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

12 files changed, 125 insertions(+), 180 deletions(-)
build/jam/UserBuildConfig.ReadMe                 |  16 +--
build/jam/UserBuildConfig.sample                 |   2 +-
build/jam/repositories/HaikuPorts/x86_gcc2       |   8 +-
headers/os/net/HttpRequest.h                     |   8 --
headers/os/net/UrlRequest.h                      |  21 ----
src/apps/webpositive/BrowserApp.cpp              |   2 -
src/kits/network/libnetapi/DataRequest.cpp       |  10 +-
src/kits/network/libnetapi/FileRequest.cpp       | 105 ++++++++++---------
src/kits/network/libnetapi/HttpRequest.cpp       |  43 +++-----
src/kits/network/libnetapi/NetworkCookie.cpp     |  51 ++++-----
src/kits/network/libnetapi/UrlRequest.cpp        |  37 +------
.../network/libnetapi/UrlSynchronousRequest.cpp  |   2 +-

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

Commit:      5e9a96156d64a49b7dacd6b59374b243b2fccad1
URL:         http://cgit.haiku-os.org/haiku/commit/?id=5e9a961
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Fri Jan 10 15:07:27 2014 UTC

FileRequest: style fixes

Pointed out by axeld, stippi and waddlesplash. Thanks for watching.

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

diff --git a/src/kits/network/libnetapi/FileRequest.cpp 
b/src/kits/network/libnetapi/FileRequest.cpp
index cad1502..2ebed52 100644
--- a/src/kits/network/libnetapi/FileRequest.cpp
+++ b/src/kits/network/libnetapi/FileRequest.cpp
@@ -7,7 +7,6 @@
  */
 
 
-#include <stdio.h>
 #include <stdlib.h>
 
 #include <Directory.h>
@@ -84,20 +83,19 @@ BFileRequest::_ProtocolLoop()
                int size = 0;
                char name[B_FILE_NAME_LENGTH];
                BEntry entry;
-               while(directory.GetNextEntry(&entry) != B_ENTRY_NOT_FOUND)
-               {
+               while (directory.GetNextEntry(&entry) != B_ENTRY_NOT_FOUND) {
                        // We read directories using the EPFL (Easily Parsed 
List Format)
                        // This happens to be one of the formats that WebKit 
can understand,
                        // and it is not too hard to parse or generate.
                        // http://tools.ietf.org/html/draft-bernstein-eplf-02
                        BString epfl("+");
-                       if(entry.IsFile() || entry.IsSymLink()) {
+                       if (entry.IsFile() || entry.IsSymLink()) {
                                epfl += "r,";
                                off_t fileSize;
                                if (entry.GetSize(&fileSize) == B_OK)
                                        epfl << "s" << fileSize << ",";
 
-                       } else if(entry.IsDirectory())
+                       } else if (entry.IsDirectory())
                                epfl += "/,";
 
                        time_t modification;
@@ -106,11 +104,13 @@ BFileRequest::_ProtocolLoop()
 
                        entry.GetName(name);
                        epfl << "\t" << name << "\r\n";
-                       fListener->DataReceived(this, epfl.String(), 
epfl.Length());
+                       if (fListener != NULL)
+                               fListener->DataReceived(this, epfl.String(), 
epfl.Length());
                        size += epfl.Length();
                }
 
-               fListener->DownloadProgress(this, size, size);
+               if (fListener != NULL)
+                       fListener->DownloadProgress(this, size, size);
                fResult.SetLength(size);
 
                return B_PROT_SUCCESS;

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

Commit:      3d864cd870209032d0aa58c39b40b9cf15c79d1e
URL:         http://cgit.haiku-os.org/haiku/commit/?id=3d864cd
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Fri Jan 10 21:18:24 2014 UTC

Remove B_PROT_* and related code

Use standard error codes instead.
This allows using error code returned by the underlying functions
directly, and makes it possible to use strerror for debugging. So, we
can also remove StatusString() from the various *Request classes.

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

diff --git a/headers/os/net/HttpRequest.h b/headers/os/net/HttpRequest.h
index 4592302..cc35a85 100644
--- a/headers/os/net/HttpRequest.h
+++ b/headers/os/net/HttpRequest.h
@@ -49,7 +49,6 @@ public:
 
                        status_t                        Stop();
                        const BUrlResult&       Result() const;
-                       const char*                     StatusString(status_t 
threadStatus) const;
 
        static  bool                            IsInformationalStatusCode(int16 
code);
        static  bool                            IsSuccessStatusCode(int16 code);
@@ -123,13 +122,6 @@ private:
                        bool                            fOptAutoReferer : 1;
 };
 
-// ProtocolLoop return status
-enum {
-       B_PROT_HTTP_NOT_FOUND = B_PROT_THREAD_STATUS__END,
-       B_PROT_HTTP_THREAD_STATUS__END
-};
-
-
 // Request method
 const char* const B_HTTP_GET = "GET";
 const char* const B_HTTP_POST = "POST";
diff --git a/headers/os/net/UrlRequest.h b/headers/os/net/UrlRequest.h
index 8444ed8..641077f 100644
--- a/headers/os/net/UrlRequest.h
+++ b/headers/os/net/UrlRequest.h
@@ -42,8 +42,6 @@ public:
        // URL protocol informations
                        bool                                    IsRunning() 
const;
                        status_t                                Status() const;
-       virtual const char*                             StatusString(status_t 
threadStatus)
-                                                                               
const;
        virtual const BUrlResult&               Result() const = 0;
 
 
@@ -66,23 +64,4 @@ protected:
 };
 
 
-// TODO: Rename, this is in the global namespace.
-enum {
-       B_PROT_THREAD_STATUS__BASE      = 0,
-       B_PROT_SUCCESS = B_PROT_THREAD_STATUS__BASE,
-       B_PROT_RUNNING,
-       B_PROT_PAUSED,
-       B_PROT_ABORTED,
-       B_PROT_SOCKET_ERROR,
-       B_PROT_CONNECTION_FAILED,
-       B_PROT_CANT_RESOLVE_HOSTNAME,
-       B_PROT_WRITE_FAILED,
-       B_PROT_READ_FAILED,
-       B_PROT_NO_MEMORY,
-       B_PROT_PROTOCOL_ERROR,
-               //  Thread status over this one are guaranteed to be
-               // errors
-       B_PROT_THREAD_STATUS__END
-};
-
 #endif // _B_URL_REQUEST_H_
diff --git a/src/kits/network/libnetapi/DataRequest.cpp 
b/src/kits/network/libnetapi/DataRequest.cpp
index 1f1ce27..8da5fcc 100644
--- a/src/kits/network/libnetapi/DataRequest.cpp
+++ b/src/kits/network/libnetapi/DataRequest.cpp
@@ -36,7 +36,7 @@ BDataRequest::_ProtocolLoop()
        BString mimeType;
        BString charset;
        const char* payload;
-       size_t length;
+       ssize_t length;
        bool isBase64 = false;
 
        fUrl.UrlDecode(true);
@@ -86,6 +86,12 @@ BDataRequest::_ProtocolLoop()
                        // payload must be a const char* so we can assign 
data.String() to
                        // it below, but decode_64 modifies buffer.
                length = decode_base64(buffer, data.String(), data.Length());
+
+               // There may be some padding at the end of the base64 stream. 
This
+               // prevents us from computing the exact length we should get, 
so allow
+               // for some error margin.
+               if(length > data.Length() * 4 / 3 || length < data.Length() * 4 
/ 3 - 3)
+                       return B_BAD_DATA;
        } else {
                payload = data.String();
                length = data.Length();
@@ -102,5 +108,5 @@ BDataRequest::_ProtocolLoop()
        if (isBase64)
                delete[] payload;
 
-       return B_PROT_SUCCESS;
+       return B_OK;
 }
diff --git a/src/kits/network/libnetapi/FileRequest.cpp 
b/src/kits/network/libnetapi/FileRequest.cpp
index 2ebed52..69f8eeb 100644
--- a/src/kits/network/libnetapi/FileRequest.cpp
+++ b/src/kits/network/libnetapi/FileRequest.cpp
@@ -7,6 +7,7 @@
  */
 
 
+#include <assert.h>
 #include <stdlib.h>
 
 #include <Directory.h>
@@ -42,26 +43,35 @@ BFileRequest::_ProtocolLoop()
 {
        BNode node(fUrl.Path().String());
        node_ref ref;
-       if (node.GetNodeRef(&ref) != B_OK)
-               return B_PROT_CONNECTION_FAILED;
+       status_t error = node.GetNodeRef(&ref);
+       if (error != B_OK)
+               return error;
 
+       ssize_t transferredSize = 0;
        if (node.IsFile()) {
                BFile file(fUrl.Path().String(), B_READ_ONLY);
-               if (file.InitCheck() != B_OK)
-                       return B_PROT_CONNECTION_FAILED;
+               error = file.InitCheck();
+               if (error != B_OK)
+                       return error;
 
                // Send all notifications to listener, if any
                if (fListener != NULL) {
                        fListener->ConnectionOpened(this);
                        off_t size = 0;
                        file.GetSize(&size);
-                       fListener->DownloadProgress(this, size, size);
                        fResult.SetLength(size);
 
                        ssize_t chunkSize;
                        char chunk[4096];
-                       while ((chunkSize = file.Read(chunk, sizeof(chunk))) > 
0)
+                       while ((chunkSize = file.Read(chunk, sizeof(chunk))) > 
0) {
                                fListener->DataReceived(this, chunk, chunkSize);
+
+                               if (chunkSize > 0)
+                                       transferredSize += chunkSize;
+                               else if (transferredSize != size)
+                                       return chunkSize;
+                       }
+                       fListener->DownloadProgress(this, size, size);
                }
 
                BNodeInfo info(&file);
@@ -69,52 +79,51 @@ BFileRequest::_ProtocolLoop()
                if (info.GetType(mimeType) == B_OK)
                        fResult.SetContentType(mimeType);
 
-               return B_PROT_SUCCESS;
-       } else if (node.IsDirectory()) {
-               BDirectory directory(&ref);
-
-               fResult.SetContentType("application/x-ftp-directory");
-                       // This tells WebKit to use its FTP directory rendering 
code.
-
-               // Send all notifications to listener, if any
-               if (fListener != NULL)
-                       fListener->ConnectionOpened(this);
-
-               int size = 0;
-               char name[B_FILE_NAME_LENGTH];
-               BEntry entry;
-               while (directory.GetNextEntry(&entry) != B_ENTRY_NOT_FOUND) {
-                       // We read directories using the EPFL (Easily Parsed 
List Format)
-                       // This happens to be one of the formats that WebKit 
can understand,
-                       // and it is not too hard to parse or generate.
-                       // http://tools.ietf.org/html/draft-bernstein-eplf-02
-                       BString epfl("+");
-                       if (entry.IsFile() || entry.IsSymLink()) {
-                               epfl += "r,";
-                               off_t fileSize;
-                               if (entry.GetSize(&fileSize) == B_OK)
-                                       epfl << "s" << fileSize << ",";
-
-                       } else if (entry.IsDirectory())
-                               epfl += "/,";
-
-                       time_t modification;
-                       if (entry.GetModificationTime(&modification) == B_OK)
-                               epfl << "m" << modification << ",";
-
-                       entry.GetName(name);
-                       epfl << "\t" << name << "\r\n";
-                       if (fListener != NULL)
-                               fListener->DataReceived(this, epfl.String(), 
epfl.Length());
-                       size += epfl.Length();
-               }
+               return B_OK;
+       }
 
+       assert(node.IsDirectory());
+       BDirectory directory(&ref);
+
+       fResult.SetContentType("application/x-ftp-directory");
+               // This tells WebKit to use its FTP directory rendering code.
+
+       // Send all notifications to listener, if any
+       if (fListener != NULL)
+               fListener->ConnectionOpened(this);
+
+       int size = 0;
+       char name[B_FILE_NAME_LENGTH];
+       BEntry entry;
+       while (directory.GetNextEntry(&entry) != B_ENTRY_NOT_FOUND) {
+               // We read directories using the EPFL (Easily Parsed List 
Format)
+               // This happens to be one of the formats that WebKit can 
understand,
+               // and it is not too hard to parse or generate.
+               // http://tools.ietf.org/html/draft-bernstein-eplf-02
+               BString epfl("+");
+               if (entry.IsFile() || entry.IsSymLink()) {
+                       epfl += "r,";
+                       off_t fileSize;
+                       if (entry.GetSize(&fileSize) == B_OK)
+                               epfl << "s" << fileSize << ",";
+
+               } else if (entry.IsDirectory())
+                       epfl += "/,";
+
+               time_t modification;
+               if (entry.GetModificationTime(&modification) == B_OK)
+                       epfl << "m" << modification << ",";
+
+               entry.GetName(name);
+               epfl << "\t" << name << "\r\n";
                if (fListener != NULL)
-                       fListener->DownloadProgress(this, size, size);
-               fResult.SetLength(size);
-
-               return B_PROT_SUCCESS;
+                       fListener->DataReceived(this, epfl.String(), 
epfl.Length());
+               size += epfl.Length();
        }
 
-       return B_PROT_CONNECTION_FAILED;
+       if (fListener != NULL)
+               fListener->DownloadProgress(this, size, size);
+       fResult.SetLength(size);
+
+       return B_OK;
 }
diff --git a/src/kits/network/libnetapi/HttpRequest.cpp 
b/src/kits/network/libnetapi/HttpRequest.cpp
index 96f3bbc..53a807e 100644
--- a/src/kits/network/libnetapi/HttpRequest.cpp
+++ b/src/kits/network/libnetapi/HttpRequest.cpp
@@ -24,12 +24,6 @@
 
 
 static const int32 kHttpBufferSize = 4096;
-static const char* kHttpProtocolThreadStrStatus[
-               B_PROT_HTTP_THREAD_STATUS__END - B_PROT_THREAD_STATUS__END]
-       =  {
-               "The remote server did not found the requested resource"
-       };
-
 
 BHttpRequest::BHttpRequest(const BUrl& url, bool ssl, const char* protocolName,
        BUrlProtocolListener* listener, BUrlContext* context)
@@ -237,19 +231,6 @@ BHttpRequest::StatusCodeClass(int16 code)
 }
 
 
-const char*
-BHttpRequest::StatusString(status_t threadStatus) const
-{
-       if (threadStatus < B_PROT_THREAD_STATUS__END)
-               return BUrlRequest::StatusString(threadStatus);
-       else if (threadStatus >= B_PROT_HTTP_THREAD_STATUS__END)
-               return BUrlRequest::StatusString(-1);
-       else
-               return kHttpProtocolThreadStrStatus[threadStatus
-                       - B_PROT_THREAD_STATUS__END];
-}
-
-
 const BUrlResult&
 BHttpRequest::Result() const
 {
@@ -308,11 +289,11 @@ BHttpRequest::_ProtocolLoop()
                        _EmitDebug(B_URL_PROTOCOL_DEBUG_ERROR,
                                "Unable to resolve hostname (%s), aborting.",
                                        fUrl.Host().String());
-                       return B_PROT_CANT_RESOLVE_HOSTNAME;
+                       return B_SERVER_NOT_FOUND;
                }
 
                status_t requestStatus = _MakeRequest();
-               if (requestStatus != B_PROT_SUCCESS)
+               if (requestStatus != B_OK)
                        return requestStatus;
 
                // Prepare the referer for the next request if needed
@@ -396,9 +377,9 @@ BHttpRequest::_ProtocolLoop()
                fHeaders.CountHeaders(), fInputBuffer.Size());
 
        if (fResult.StatusCode() == 404)
-               return B_PROT_HTTP_NOT_FOUND;
+               return B_RESOURCE_NOT_FOUND;
 
-       return B_PROT_SUCCESS;
+       return B_OK;
 }
 
 
@@ -440,7 +421,7 @@ BHttpRequest::_MakeRequest()
        if (connectError != B_OK) {
                _EmitDebug(B_URL_PROTOCOL_DEBUG_ERROR, "Socket connection error 
%s",
                        strerror(connectError));
-               return B_PROT_CONNECTION_FAILED;
+               return connectError;
        }
 
        //! ProtocolHook:ConnectionOpened
@@ -506,8 +487,8 @@ BHttpRequest::_MakeRequest()
                                fSocket->Write("\r\n", 2);
                        }
 
-                       
fSocket->Write(fOptPostFields->GetMultipartFooter().String(),
-                               fOptPostFields->GetMultipartFooter().Length());
+                       BString footer = fOptPostFields->GetMultipartFooter();
+                       fSocket->Write(footer.String(), footer.Length());
                }
        } else if ((fRequestMethod == B_HTTP_POST || fRequestMethod == 
B_HTTP_PUT)
                && fOptInputData != NULL) {
@@ -546,7 +527,7 @@ BHttpRequest::_MakeRequest()
        bool receiveEnd = false;
        bool parseEnd = false;
        bool readByChunks = false;
-       bool readError = false;
+       status_t readError = B_OK;
        ssize_t bytesRead = 0;
        ssize_t bytesReceived = 0;
        ssize_t bytesTotal = 0;
@@ -561,7 +542,7 @@ BHttpRequest::_MakeRequest()
                        bytesRead = fSocket->Read(chunk.Data(), 
kHttpBufferSize);
 
                        if (bytesRead < 0) {
-                               readError = true;
+                               readError = bytesRead;
                                break;
                        } else if (bytesRead == 0)
                                receiveEnd = true;
@@ -692,10 +673,10 @@ BHttpRequest::_MakeRequest()
        fSocket->Disconnect();
        delete[] inputTempBuffer;
 
-       if (readError)
-               return B_PROT_READ_FAILED;
+       if (readError != B_OK)
+               return readError;
 
-       return fQuit ? B_PROT_ABORTED : B_PROT_SUCCESS;
+       return fQuit ? B_INTERRUPTED : B_OK;
 }
 
 
diff --git a/src/kits/network/libnetapi/UrlRequest.cpp 
b/src/kits/network/libnetapi/UrlRequest.cpp
index 351aa16..b3168b1 100644
--- a/src/kits/network/libnetapi/UrlRequest.cpp
+++ b/src/kits/network/libnetapi/UrlRequest.cpp
@@ -12,21 +12,6 @@
 #include <stdio.h>
 
 
-static const char* kProtocolThreadStrStatus[B_PROT_THREAD_STATUS__END + 1]
-       =  {
-               "Request successfully completed",
-               "Request running",
-               "Socket error",
-               "Connection failed",
-               "Hostname resolution failed",
-               "Network write failed",
-               "Network read failed",
-               "Out of memory",
-               "Protocol-specific error",
-               "Unknown error"
-               };
-
-
 BUrlRequest::BUrlRequest(const BUrl& url, BUrlProtocolListener* listener,
        BUrlContext* context, const char* threadName, const char* protocolName)
        :
@@ -35,7 +20,7 @@ BUrlRequest::BUrlRequest(const BUrl& url, 
BUrlProtocolListener* listener,
        fListener(listener),
        fQuit(false),
        fRunning(false),
-       fThreadStatus(B_PROT_PAUSED),
+       fThreadStatus(B_NO_INIT),
        fThreadId(0),
        fThreadName(threadName),
        fProtocol(protocolName)
@@ -195,18 +180,6 @@ BUrlRequest::Status() const
 }
 
 
-const char*
-BUrlRequest::StatusString(status_t threadStatus) const
-{
-       if (threadStatus < B_PROT_THREAD_STATUS__BASE)
-               threadStatus = B_PROT_THREAD_STATUS__END;
-       else if (threadStatus >= B_PROT_PROTOCOL_ERROR)
-               threadStatus = B_PROT_PROTOCOL_ERROR;
-
-       return kProtocolThreadStrStatus[threadStatus];
-}
-
-
 // #pragma mark Thread management
 
 
@@ -214,7 +187,7 @@ BUrlRequest::StatusString(status_t threadStatus) const
 BUrlRequest::_ThreadEntry(void* arg)
 {
        BUrlRequest* urlProtocol = reinterpret_cast<BUrlRequest*>(arg);
-       urlProtocol->fThreadStatus = B_PROT_RUNNING;
+       urlProtocol->fThreadStatus = B_BUSY;
 
        status_t protocolLoopExitStatus = urlProtocol->_ProtocolLoop();
 
@@ -223,7 +196,7 @@ BUrlRequest::_ThreadEntry(void* arg)
 
        if (urlProtocol->fListener != NULL) {
                urlProtocol->fListener->RequestCompleted(urlProtocol,
-                       protocolLoopExitStatus == B_PROT_SUCCESS);
+                       protocolLoopExitStatus == B_OK);
        }
 
        return B_OK;
@@ -240,8 +213,8 @@ BUrlRequest::_EmitDebug(BUrlProtocolDebugMessage type,
        va_list arguments;
        va_start(arguments, format);
 
-       char debugMsg[256];
-       vsnprintf(debugMsg, 256, format, arguments);
+       char debugMsg[1024];
+       vsnprintf(debugMsg, sizeof(debugMsg), format, arguments);
        fListener->DebugMessage(this, type, debugMsg);
        va_end(arguments);
 }
diff --git a/src/kits/network/libnetapi/UrlSynchronousRequest.cpp 
b/src/kits/network/libnetapi/UrlSynchronousRequest.cpp
index c58479e..050d46b 100644
--- a/src/kits/network/libnetapi/UrlSynchronousRequest.cpp
+++ b/src/kits/network/libnetapi/UrlSynchronousRequest.cpp
@@ -107,6 +107,6 @@ void
 BUrlSynchronousRequest::RequestCompleted(BUrlRequest* caller, bool success)
 {
        PRINT(("SynchronousRequest::RequestCompleted(%s) : %s\n", 
(success?"true":"false"),
-               caller->StatusString(caller->Status())));
+               strerror(caller->Status())));
        fRequestComplete = true;
 }

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

Commit:      121a158f9c40c391ad97d19a6441f8a81f1bfaf3
URL:         http://cgit.haiku-os.org/haiku/commit/?id=121a158
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Sat Jan 11 10:22:40 2014 UTC

Lua: update to bugfixed package

The previous version didn't work at all.

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

diff --git a/build/jam/repositories/HaikuPorts/x86_gcc2 
b/build/jam/repositories/HaikuPorts/x86_gcc2
index 2a5856e..0707f6b 100644
--- a/build/jam/repositories/HaikuPorts/x86_gcc2
+++ b/build/jam/repositories/HaikuPorts/x86_gcc2
@@ -118,7 +118,7 @@ RemotePackageRepository HaikuPorts
        libxml2_python-2.8.0-6
        libxslt-1.1.28-2
        libxslt_devel-1.1.28-2
-       lua-5.2.1-3
+       lua-5.2.1-6
        m4-1.4.16-5
        make-3.82-5
        man-1.6g-3

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

Commit:      024e81af86eebd8fa0474522b215fd891c27bdef
URL:         http://cgit.haiku-os.org/haiku/commit/?id=024e81a
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Sun Jan 12 16:56:52 2014 UTC

Update UserBuildConfig readme and sample

AddOptionalHaikuImagePackage is replaced with AddHaikuImagePackages.

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

diff --git a/build/jam/UserBuildConfig.ReadMe b/build/jam/UserBuildConfig.ReadMe
index 2393d1e..e3b13fc 100644
--- a/build/jam/UserBuildConfig.ReadMe
+++ b/build/jam/UserBuildConfig.ReadMe
@@ -142,13 +142,13 @@ ExtractArchiveToHaikuImage develop tools
 
 # Add the optional package WonderBrush to the image. The package is downloaded
 # via wget (i.e. wget must be installed).
-AddOptionalHaikuImagePackages WonderBrush ;
+AddHaikuImagePackages WonderBrush ;
 
 # Add the optional package WebPositive to the image but don't add its
 # dependent SQLite optional package to the image. WebPositive still needs
 # SQLite to run, this allows you to test a different version of it though.
 AddOptionalHaikuImagePackages WebPositive ;
-SuppressOptionalHaikuImagePackages SQLite ;
+SuppressHaikuImagePackages SQLite ;
 
 # Specify scripts that shall be run when populating the image/installation
 # directory. The "early" script is run before anything has been copied onto
@@ -210,9 +210,9 @@ DefineBuildProfile install : install : /Haiku2 ;
 
 switch $(HAIKU_BUILD_PROFILE) {
        case "disk" : {
-               AddOptionalHaikuImagePackages BeBook BeHappy BePDF Bluetooth CVS
-                       Development Firefox OpenSSH OpenSSL P7zip Pe Subversion 
Vision
-                       Welcome WonderBrush ;
+               AddOptionalHaikuImagePackages BeBook BeHappy Bluetooth 
Development
+                       OpenSSH OpenSSL Welcome ;
+               AddHaikuImagePackages bepdf cvs p7zip pe subversion vision 
wonderbrush ;
        }
 
        case "qemu" : {
@@ -222,7 +222,8 @@ switch $(HAIKU_BUILD_PROFILE) {
        case "vmware" : {
                HAIKU_IMAGE_SIZE = 400 ;
                HAIKU_DONT_CLEAR_IMAGE = 1 ;
-               AddOptionalHaikuImagePackages Development Pe ;
+               AddOptionalHaikuImagePackages Development ;
+               AddHaikuImagePackages pe ;
        }
 
        case "anyboot" : {
@@ -232,7 +233,8 @@ switch $(HAIKU_BUILD_PROFILE) {
        case "crash" : {
                HAIKU_IMAGE_SIZE = 1024 ;
                HAIKU_DONT_CLEAR_IMAGE = 1 ;
-               AddOptionalHaikuImagePackages Development Pe ;
+               AddOptionalHaikuImagePackages Development ;
+               AddHaikuImagePackages pe ;
                CopyDirectoryToHaikuImage home Desktop : 
$(HAIKU_TOP)/../crash-tests ;
        }
 }
diff --git a/build/jam/UserBuildConfig.sample b/build/jam/UserBuildConfig.sample
index 8a5160f..4d4fa79 100644
--- a/build/jam/UserBuildConfig.sample
+++ b/build/jam/UserBuildConfig.sample
@@ -26,7 +26,7 @@
 
 
 # Add the optional package WonderBrush to the image.
-#AddOptionalHaikuImagePackages WonderBrush ;
+#AddHaikuImagePackages WonderBrush ;
 
 # Add an example optional gfx driver and its accelerant.
 # (Drivers just have a special rule because of the need for the symlink in 
dev/)

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

Commit:      aa5101ce5c0b81906355c2299f7b2508f8f5b01a
URL:         http://cgit.haiku-os.org/haiku/commit/?id=aa5101c
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Mon Jan 13 08:02:35 2014 UTC

Update HaikuWebKit package to version 1.2.3.

Older versions will not work anymore because of the API changes in
network kit (removal of nonstandard B_PROT_* status codes). x86 and
x86_64 packages have to be updated again.

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

diff --git a/build/jam/repositories/HaikuPorts/x86_gcc2 
b/build/jam/repositories/HaikuPorts/x86_gcc2
index 0707f6b..fb5416c 100644
--- a/build/jam/repositories/HaikuPorts/x86_gcc2
+++ b/build/jam/repositories/HaikuPorts/x86_gcc2
@@ -119,6 +119,7 @@ RemotePackageRepository HaikuPorts
        libxslt-1.1.28-2
        libxslt_devel-1.1.28-2
        lua-5.2.1-6
+       lua_devel-5.2.1-6
        m4-1.4.16-5
        make-3.82-5
        man-1.6g-3
@@ -209,8 +210,8 @@ RemotePackageRepository HaikuPorts
        glu_x86_devel-9.0.0-2
        guilib_x86-1.2.1-1
        guilib_x86_devel-1.2.1-1
-       haikuwebkit_x86-1.2.2-1
-       haikuwebkit_x86_devel-1.2.2-1
+       haikuwebkit_x86-1.2.3-1
+       haikuwebkit_x86_devel-1.2.3-1
        icu_x86-4.8.1.1-4
        icu_x86_devel-4.8.1.1-4
        jpeg_x86-9-3
@@ -355,6 +356,7 @@ RemotePackageRepository HaikuPorts
        libxml2_x86
        libxslt
        libxslt_x86
+       lua
        m4
        make
        man
diff --git a/src/apps/webpositive/BrowserApp.cpp 
b/src/apps/webpositive/BrowserApp.cpp
index 0a9517b..d2a7bf3 100644
--- a/src/apps/webpositive/BrowserApp.cpp
+++ b/src/apps/webpositive/BrowserApp.cpp
@@ -120,9 +120,7 @@ BrowserApp::AboutRequested()
 
        BString aboutText("");
        aboutText << "HaikuWebKit " << WebKitInfo::HaikuWebKitVersion();
-       aboutText << " (" << WebKitInfo::HaikuWebKitRevision() << ")";
        aboutText << "\nWebKit " << WebKitInfo::WebKitVersion();
-       aboutText << " (" << WebKitInfo::WebKitRevision() << ")";
 
        window->AddCopyright(2007, "Haiku, Inc.");
        window->AddAuthors(authors);

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

Revision:    hrev46664
Commit:      b3cc244542c94f4bf285caaa94efc7a67ad14248
URL:         http://cgit.haiku-os.org/haiku/commit/?id=b3cc244
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Mon Jan 13 08:05:19 2014 UTC

Simplify cookie string-ification code.

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

diff --git a/src/kits/network/libnetapi/NetworkCookie.cpp 
b/src/kits/network/libnetapi/NetworkCookie.cpp
index a9f3a33..d3a1172 100644
--- a/src/kits/network/libnetapi/NetworkCookie.cpp
+++ b/src/kits/network/libnetapi/NetworkCookie.cpp
@@ -39,11 +39,11 @@ BNetworkCookie::BNetworkCookie(const char* name, const 
char* value,
 
        SetDomain(url.Host());
 
-    if(url.Protocol() == "file" && url.Host().Length() == 0)
-    {
-        SetDomain("localhost");
-            // make sure cookies set from a file:// URL are stored somewhere.
-    }
+       if (url.Protocol() == "file" && url.Host().Length() == 0)
+       {
+               SetDomain("localhost");
+                       // make sure cookies set from a file:// URL are stored 
somewhere.
+       }
 
        SetPath(_DefaultPathForUrl(url));
 }
@@ -100,13 +100,13 @@ BNetworkCookie::ParseCookieString(const BString& string, 
const BUrl& url)
        SetPath(_DefaultPathForUrl(url));
        SetDomain(url.Host());
        fHostOnly = true;
-    if(url.Protocol() == "file" && url.Host().Length() == 0)
-    {
-        fDomain = "localhost";
-            // make sure cookies set from a file:// URL are stored somewhere.
-            // not going through SetDomain as it requires at least one '.'
-            // in the domain (to avoid setting cookies on TLDs).
-    }
+       if (url.Protocol() == "file" && url.Host().Length() == 0)
+       {
+               fDomain = "localhost";
+                       // make sure cookies set from a file:// URL are stored 
somewhere.
+                       // not going through SetDomain as it requires at least 
one '.'
+                       // in the domain (to avoid setting cookies on TLDs).
+       }
 
        BString name;
        BString value;
@@ -378,11 +378,19 @@ BNetworkCookie::HttpOnly() const
 const BString&
 BNetworkCookie::RawCookie(bool full) const
 {
-       if (full && !fRawFullCookieValid) {
-               fRawFullCookie.Truncate(0);
-               fRawFullCookieValid = true;
+       if (!fRawCookieValid) {
+               fRawCookie.Truncate(0);
+               fRawCookieValid = true;
+
+               fRawCookie << fName << "=" << fValue;
+       }
+
+       if (!full)
+               return fRawCookie;
 
-               fRawFullCookie << fName << "=" << fValue;
+       if (!fRawFullCookieValid) {
+               fRawFullCookie = fRawCookie;
+               fRawFullCookieValid = true;
 
                if (HasDomain())
                        fRawFullCookie << "; Domain=" << fDomain;
@@ -395,14 +403,9 @@ BNetworkCookie::RawCookie(bool full) const
                if (HttpOnly())
                        fRawFullCookie << "; HttpOnly";
 
-       } else if (!full && !fRawCookieValid) {
-               fRawCookie.Truncate(0);
-               fRawCookieValid = true;
-
-               fRawCookie << fName << "=" << fValue;
        }
 
-       return full ? fRawFullCookie : fRawCookie;
+       return fRawFullCookie;
 }
 
 
@@ -436,8 +439,8 @@ BNetworkCookie::IsValidForUrl(const BUrl& url) const
        if (Secure() && url.Protocol() != "https")
                return false;
 
-    if (url.Protocol() == "file")
-        return Domain() == "localhost" && IsValidForPath(url.Path());
+       if (url.Protocol() == "file")
+               return Domain() == "localhost" && IsValidForPath(url.Path());
 
        return IsValidForDomain(url.Host()) && IsValidForPath(url.Path());
 }


Other related posts:

  • » [haiku-commits] haiku: hrev46664 - src/kits/network/libnetapi build/jam headers/os/net - pulkomandy