Discussion:
[Xcb] [PATCH] res: Fix GetClientIds reply size
Peter Harris
2016-05-24 21:00:52 UTC
Permalink
This diverges from the specification to match the current implementation
of the server.
---
src/res.xml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/res.xml b/src/res.xml
index 17e6f83..c7cdf48 100644
--- a/src/res.xml
+++ b/src/res.xml
@@ -55,7 +55,10 @@ authorization from the authors.
<field type="ClientIdSpec" name="spec" />
<field type="CARD32" name="length" />
<list type="CARD32" name="value">
- <fieldref>length</fieldref>
+ <op op="/">
+ <fieldref>length</fieldref>
+ <value>4</value>
+ </op>
</list>
</struct>
--
2.7.4
Tycho Andersen
2016-05-25 16:30:43 UTC
Permalink
Post by Peter Harris
This diverges from the specification to match the current implementation
of the server.
Acked-by: Tycho Andersen <***@tycho.ws>

Thanks, Peter.
Post by Peter Harris
---
src/res.xml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/res.xml b/src/res.xml
index 17e6f83..c7cdf48 100644
--- a/src/res.xml
+++ b/src/res.xml
@@ -55,7 +55,10 @@ authorization from the authors.
<field type="ClientIdSpec" name="spec" />
<field type="CARD32" name="length" />
<list type="CARD32" name="value">
- <fieldref>length</fieldref>
+ <op op="/">
+ <fieldref>length</fieldref>
+ <value>4</value>
+ </op>
</list>
</struct>
--
2.7.4
_______________________________________________
Xcb mailing list
https://lists.freedesktop.org/mailman/listinfo/xcb
Ran Benita
2016-05-25 17:40:09 UTC
Permalink
Post by Peter Harris
This diverges from the specification to match the current implementation
of the server.
Title should say "QueryClientIds".

If it diverges from the spec, it would nice to have a comment saying so,
otherwise someone might come in and "fix" it.

About the patch itself: I had a brief look at the server code, it's
pretty convoluted, but I think it sends a single pid and sets length=4,
otherwise doesn't send anything and sets length=0. So patch looks
correct.

Ran
Post by Peter Harris
---
src/res.xml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/res.xml b/src/res.xml
index 17e6f83..c7cdf48 100644
--- a/src/res.xml
+++ b/src/res.xml
@@ -55,7 +55,10 @@ authorization from the authors.
<field type="ClientIdSpec" name="spec" />
<field type="CARD32" name="length" />
<list type="CARD32" name="value">
- <fieldref>length</fieldref>
+ <op op="/">
+ <fieldref>length</fieldref>
+ <value>4</value>
+ </op>
</list>
</struct>
--
2.7.4
_______________________________________________
Xcb mailing list
https://lists.freedesktop.org/mailman/listinfo/xcb
Peter Harris
2016-05-26 16:37:19 UTC
Permalink
The specification disagrees with itself, so use the part of the
specification that matches the other implementations.
---

Thanks to Ran Benita for the review.

src/res.xml | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/res.xml b/src/res.xml
index 17e6f83..be32ca1 100644
--- a/src/res.xml
+++ b/src/res.xml
@@ -55,7 +55,15 @@ authorization from the authors.
<field type="ClientIdSpec" name="spec" />
<field type="CARD32" name="length" />
<list type="CARD32" name="value">
- <fieldref>length</fieldref>
+ <!-- The specification says that the length is in units of CARD32,
+ but the specification also says that the length is 4 when a
+ single LocalClientPid is present (ie. the length is in bytes).
+ The current server implementation sets the length to 4 when a
+ single CARD32 is present on the wire (length is in bytes). -->
+ <op op="/">
+ <fieldref>length</fieldref>
+ <value>4</value>
+ </op>
</list>
</struct>
--
2.7.4
Ran Benita
2016-05-27 11:58:26 UTC
Permalink
Post by Peter Harris
The specification disagrees with itself, so use the part of the
specification that matches the other implementations.
Reviewed-by: Ran Benita <***@gmail.com>

Ran
Post by Peter Harris
---
Thanks to Ran Benita for the review.
src/res.xml | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/res.xml b/src/res.xml
index 17e6f83..be32ca1 100644
--- a/src/res.xml
+++ b/src/res.xml
@@ -55,7 +55,15 @@ authorization from the authors.
<field type="ClientIdSpec" name="spec" />
<field type="CARD32" name="length" />
<list type="CARD32" name="value">
- <fieldref>length</fieldref>
+ <!-- The specification says that the length is in units of CARD32,
+ but the specification also says that the length is 4 when a
+ single LocalClientPid is present (ie. the length is in bytes).
+ The current server implementation sets the length to 4 when a
+ single CARD32 is present on the wire (length is in bytes). -->
+ <op op="/">
+ <fieldref>length</fieldref>
+ <value>4</value>
+ </op>
</list>
</struct>
--
2.7.4
_______________________________________________
Xcb mailing list
https://lists.freedesktop.org/mailman/listinfo/xcb
Peter Harris
2016-06-02 14:32:38 UTC
Permalink
Post by Peter Harris
The specification disagrees with itself, so use the part of the
specification that matches the other implementations.
Thanks. Pushed.

Peter Harris
--
Open Text Connectivity Solutions Group
Peter Harris http://connectivity.opentext.com/
Research and Development Phone: +1 905 762 6001
***@opentext.com Toll Free: 1 877 359 4866
Loading...