qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (QPID-5489) C++ Uuid code needs cleaning up
Date Fri, 17 Jan 2014 05:56:19 GMT

    [ https://issues.apache.org/jira/browse/QPID-5489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13874470#comment-13874470
] 

ASF subversion and git services commented on QPID-5489:
-------------------------------------------------------

Commit 1559017 from [~astitcher] in branch 'qpid/trunk'
[ https://svn.apache.org/r1559017 ]

QPID-5489: Uuid code improvements
- Don't use uuid_compare() as it will get the wrong version of the
  function under FreeBSD which has a uuid library build into libc with
  different function signatures from libuuid but some overlapping names.
- Reorganise the uuid code to limit the used external symbols to uuid_generate(),
  uuid_parse(), uuid_unparse()
- Minimise the framing::Uuid code so that it is a simple wrapper around types::Uuid
- Use uuid_generate() as the symbol to search in CMake (uuid_compare() isn't used
  in qpid anymore).

> C++ Uuid code needs cleaning up
> -------------------------------
>
>                 Key: QPID-5489
>                 URL: https://issues.apache.org/jira/browse/QPID-5489
>             Project: Qpid
>          Issue Type: Improvement
>          Components: C++ Broker, C++ Clustering
>         Environment: FreeBSD
>            Reporter: Andrew Stitcher
>            Assignee: Andrew Stitcher
>            Priority: Minor
>
> The Uuid encapsulating code is a bit of a mess in qpid:
> There are 2 nearly parallel implementations with only minor differences - qpid::framing::Uuid
and qpid::types::Uuid. The reason for this historical with types::Uuids being written to supplant
framing::Uuid to avoid its pernicious dependencies.
> However at this point the framing version is not widely used and can be mostly removed
in favour of the types version.
> Added to this is an issue in the FreeBSD port: This has a uuid_compare() function actually
implemented in libc - in addition to the one in libuuid. The two are incompatible. However
the version in libc seems to be used preferentially even if libuuid is linked in - I'm not
sure why.
> So it would be a good idea to just avoid uuid_compare completely. Fortunately we can
in fact do this - we hold uuids in memory in the same order that they appear on the wire (for
easy receiving and sending) in this case the uuid_compare is actually exactly the same as
doing a memcmp() over the raw bytes.
> It turns out that once you have done this the only library calls that we are left meeding
are uuid_generate(), uuid_parse() & uuid_unparse(). And _parse and _unparse would be very
simple to replace because they just read/write the bytes in the order that we keep them in
memory and add/remove '-' characters in the correct place.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message