[Xapian-tickets] [Xapian] #738: Fix remote backend on 64-bit MS Windows

Xapian nobody at xapian.org
Fri Mar 23 22:40:13 GMT 2018


#738: Fix remote backend on 64-bit MS Windows
----------------------------+--------------------------------------
 Reporter:  olly            |             Owner:  olly
     Type:  defect          |            Status:  new
 Priority:  low             |         Milestone:  1.4.x
Component:  Backend-Remote  |           Version:  1.4.0
 Severity:  normal          |        Resolution:
 Keywords:                  |        Blocked By:
 Blocking:                  |  Operating System:  Microsoft Windows
----------------------------+--------------------------------------
Description changed by olly:

Old description:

> The remote backend code assumes it can cast `HANDLE` to `int` and back
> and preserve the value.  But `HANDLE` is `void*` so that fails for the
> 64-bit version of this platform.
>
> The inherent problem is that sockets aren't just normal fds on this
> platform, which doesn't match the POSIX model.  I think the simplest fix
> is probably to allocate a large `int` value (well above the max possible
> fd supported) for each `HANDLE` value, and then have a suitable data
> structure to map these back to the `HANDLE` values.
>
> Doesn't affect the library ABI so could be implemented in 1.4.x.  Also
> affects 1.2.x.
>
> Not actually reported by users (I just noticed this while working on the
> code) to setting as "low" priority.

New description:

 The remote backend code assumes it can cast `HANDLE` to `int` and back and
 preserve the value.  But `HANDLE` is an unsigned integer type with the
 same width as a pointer so that fails for the 64-bit version of this
 platform.

 The inherent problem is that sockets aren't just normal fds on this
 platform, which doesn't match the POSIX model.  I think the simplest fix
 is probably to allocate a large `int` value (well above the max possible
 fd supported) for each `HANDLE` value, and then have a suitable data
 structure to map these back to the `HANDLE` values.

 Doesn't affect the library ABI so could be implemented in 1.4.x.  Also
 affects 1.2.x.

 Not actually reported by users (I just noticed this while working on the
 code) to setting as "low" priority.

--

--
Ticket URL: <https://trac.xapian.org/ticket/738#comment:2>
Xapian <https://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list