<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>31048</bug_id>
          
          <creation_ts>2009-11-03 01:15:36 -0800</creation_ts>
          <short_desc>strnstr not available on Solaris</short_desc>
          <delta_ts>2009-11-03 20:34:29 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>30647</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="t.hirsch@web.de">t.hirsch</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>160011</commentid>
    <comment_count>0</comment_count>
    <who name="t.hirsch@web.de">t.hirsch</who>
    <bug_when>2009-11-03 01:15:36 -0800</bug_when>
    <thetext>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&apos;s a suggestion for a patch, but I&apos;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, &quot;\r\n\r\n&quot;, end - p)) {
+ if (!strstr(p, &quot;\r\n\r\n&quot;)) {
// Just hasn&apos;t been received fully yet.
return -1;
}

(this diff was taken in the WebKit version that comes in Qt)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>160301</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-11-03 20:34:29 -0800</bug_when>
    <thetext>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 &lt;http://webkit.org/coding/contributing.html&gt; (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 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>