Thrift
  1. Thrift
  2. THRIFT-1512

Thrift socket support for Windows XP

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.8
    • Fix Version/s: 0.9
    • Component/s: C++ - Library
    • Environment:

      Windows XP, Visual Studio

    • Patch Info:
      Patch Available

      Description

      This is a follow-up patch to THRIFT-1490. The previous code would never follow the Windows XP path (WINVER 0x0501). At least that appears to be the case since poll_win32() was incomplete and not functional. Windows' version of select() does not set the revents field so FD_ISSET is used to determine how to manually set it. I've tested this on a sample project and it's working as expected. config.h is now targeting XP for wider compatibility. If this isn't desired or you don't trust the new code, comment out the two #define lines toward the top and it will revert to targeting Vista/Win7.

        Activity

        Hide
        Peace C added a comment - - edited

        I'm going to upload a another patch to replace the first one.

        Show
        Peace C added a comment - - edited I'm going to upload a another patch to replace the first one.
        Hide
        Peace C added a comment -

        Updated patch defines WINVER in force_inc.h instead of config.h. This makes it specific to the Thrift library and doesn't override other projects which include windows/config.h.

        See README_WINDOWS for more details.

        Show
        Peace C added a comment - Updated patch defines WINVER in force_inc.h instead of config.h. This makes it specific to the Thrift library and doesn't override other projects which include windows/config.h. See README_WINDOWS for more details.
        Hide
        Roger Meier added a comment -

        I had the following issues:

        Thrift_XP_skt.patch:8: trailing whitespace.
        Windows version compatibility
        Thrift_XP_skt.patch:9: trailing whitespace.
        =============================
        Thrift_XP_skt.patch:10: trailing whitespace.
        The Thrift library targets Windows XP for broadest compatbility. A notable
        Thrift_XP_skt.patch:11: trailing whitespace.
        difference is in the Windows-specific implementation of the socket poll
        Thrift_XP_skt.patch:12: trailing whitespace.
        function. To target Vista, Win7 or other versions, comment out the line
        error: patch failed: lib/cpp/README_WINDOWS:75
        error: lib/cpp/README_WINDOWS: patch does not apply
        error: patch failed: lib/cpp/src/windows/TargetVersion.h:28
        error: lib/cpp/src/windows/TargetVersion.h: patch does not apply
        error: patch failed: lib/cpp/src/windows/config.h:78
        error: lib/cpp/src/windows/config.h: patch does not apply
        error: patch failed: lib/cpp/src/windows/force_inc.h:18
        error: lib/cpp/src/windows/force_inc.h: patch does not apply
        

        Peace, could you please rebase this patch to trunk?

        -roger

        Show
        Roger Meier added a comment - I had the following issues: Thrift_XP_skt.patch:8: trailing whitespace. Windows version compatibility Thrift_XP_skt.patch:9: trailing whitespace. ============================= Thrift_XP_skt.patch:10: trailing whitespace. The Thrift library targets Windows XP for broadest compatbility. A notable Thrift_XP_skt.patch:11: trailing whitespace. difference is in the Windows-specific implementation of the socket poll Thrift_XP_skt.patch:12: trailing whitespace. function. To target Vista, Win7 or other versions, comment out the line error: patch failed: lib/cpp/README_WINDOWS:75 error: lib/cpp/README_WINDOWS: patch does not apply error: patch failed: lib/cpp/src/windows/TargetVersion.h:28 error: lib/cpp/src/windows/TargetVersion.h: patch does not apply error: patch failed: lib/cpp/src/windows/config.h:78 error: lib/cpp/src/windows/config.h: patch does not apply error: patch failed: lib/cpp/src/windows/force_inc.h:18 error: lib/cpp/src/windows/force_inc.h: patch does not apply Peace, could you please rebase this patch to trunk? -roger
        Hide
        Peace C added a comment -

        Roger - It looks like I didn't set Unix EOL on the previous patch. Sorry about that! I pulled from the trunk again to make sure but the patch file is identical except for the EOLs.

        Show
        Peace C added a comment - Roger - It looks like I didn't set Unix EOL on the previous patch. Sorry about that! I pulled from the trunk again to make sure but the patch file is identical except for the EOLs.
        Hide
        Roger Meier added a comment -

        Thanks Peace!
        committed with little edits (2 spaces instead of tabs).

        Show
        Roger Meier added a comment - Thanks Peace! committed with little edits (2 spaces instead of tabs).
        Hide
        Hudson added a comment -

        Integrated in Thrift #401 (See https://builds.apache.org/job/Thrift/401/)
        THRIFT-1512 Thrift socket support for Windows XP
        Patch: Peace C

        roger : http://svn.apache.org/viewvc/?view=rev&rev=1241171
        Files :

        • /thrift/trunk/lib/cpp/README_WINDOWS
        • /thrift/trunk/lib/cpp/src/windows/TargetVersion.h
        • /thrift/trunk/lib/cpp/src/windows/config.h
        • /thrift/trunk/lib/cpp/src/windows/force_inc.h
        Show
        Hudson added a comment - Integrated in Thrift #401 (See https://builds.apache.org/job/Thrift/401/ ) THRIFT-1512 Thrift socket support for Windows XP Patch: Peace C roger : http://svn.apache.org/viewvc/?view=rev&rev=1241171 Files : /thrift/trunk/lib/cpp/README_WINDOWS /thrift/trunk/lib/cpp/src/windows/TargetVersion.h /thrift/trunk/lib/cpp/src/windows/config.h /thrift/trunk/lib/cpp/src/windows/force_inc.h

          People

          • Assignee:
            Peace C
            Reporter:
            Peace C
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development