Skip to content
Snippets Groups Projects
Commit 14ba4385 authored by Niels Möller's avatar Niels Möller
Browse files

* Requests.pmod (GetProperty): Fixed error handling, I hope.

Rev: lib/modules/Protocols.pmod/X.pmod/Requests.pmod:1.13
parent fa63f1f9
No related branches found
No related tags found
No related merge requests found
...@@ -326,6 +326,16 @@ class GetProperty ...@@ -326,6 +326,16 @@ class GetProperty
sscanf(reply->rest, "%4c%4c%4c", sscanf(reply->rest, "%4c%4c%4c",
m->type, m->bytesAfter, length); m->type, m->bytesAfter, length);
/* Match and Property errors (as in rfc-1013) are not used,
* according to the official specification. For non-existent
* properties, format == 0 is returned.
*
* If types doesn't match, format is non-zero, the actual type is
* returned, but the data is empty (length = 0). */
if ( (!m->format) || (type && (type != m->type)))
return 0;
switch(m->format) switch(m->format)
{ {
case 8: case 8:
...@@ -359,8 +369,6 @@ class GetProperty ...@@ -359,8 +369,6 @@ class GetProperty
* unexpected type, or too short, return 0 */ * unexpected type, or too short, return 0 */
switch (reply->errorCode) switch (reply->errorCode)
{ {
case "Property":
case "Match":
case "Value": case "Value":
return 0; return 0;
case "Atom": case "Atom":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment