Bug 31048 - strnstr not available on Solaris
: strnstr not available on Solaris
Status: RESOLVED DUPLICATE of bug 30647
: WebKit
WebCore Misc.
: 528+ (Nightly build)
: PC Other
: P2 Normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2009-11-03 01:15 PST by
Modified: 2009-11-03 20:34 PST (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2009-11-03 01:15:36 PST
In the file WebCore/websockets/WebSocketHandshake.cpp in line 255 you make use of strnstr(), which is not available on Solaris. If you can avoid it, WebKit would compile on Solaris.

Here's a suggestion for a patch, but I'm not sure if strstr() really does the same thing as strnstr() was doing before.

diff --git
a/src/3rdparty/webkit/WebCore/websockets/WebSocketHandshake.cpp
b/src/3rdparty/webkit/WebCore/websockets/W
index 691fa1c..1974f68 100644
--- a/src/3rdparty/webkit/WebCore/websockets/WebSocketHandshake.cpp
+++ b/src/3rdparty/webkit/WebCore/websockets/WebSocketHandshake.cpp
@@ -252,7 +252,7 @@ int WebSocketHandshake::readServerHandshake(const
char* header, size_t len)
p += sizeof(webSocketConnectionHeader) - 1;
}
- if (!strnstr(p, "\r\n\r\n", end - p)) {
+ if (!strstr(p, "\r\n\r\n")) {
// Just hasn't been received fully yet.
return -1;
}

(this diff was taken in the WebKit version that comes in Qt)
------- Comment #1 From 2009-11-03 20:34:29 PST -------
This is not the right fix for the problem. We have a portable implementation of strnstr in wtf/StringExtras.h, so what needs to be done is adding Solaris to an #if guarding the implementation.

Please submit patches for review as described in <http://webkit.org/coding/contributing.html> (in this particular case, we actually already have a patch submitted, but it was overlooked, because the contributor failed to set review? flag).

*** This bug has been marked as a duplicate of bug 30647 ***