diff options
author | phsultan <phsultan@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-06 17:00:58 +0000 |
---|---|---|
committer | phsultan <phsultan@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-06 17:00:58 +0000 |
commit | 54abeb89e19b2760be6416666f51d512f2230026 (patch) | |
tree | e639a83ec1a282f33b2458ed7c80ec1a2b721247 /include | |
parent | ce3fb86cea36f7a6ee5504e8cc0ce0240fec0392 (diff) |
Merged revisions 81743 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r81743 | phsultan | 2007-09-06 18:56:29 +0200 (Thu, 06 Sep 2007) | 1 line
Various string length fixes. Removed an unused variable in aji_client structure (context)
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81745 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/jabber.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/include/asterisk/jabber.h b/include/asterisk/jabber.h index 53c3fbed5..3ad20d368 100644 --- a/include/asterisk/jabber.h +++ b/include/asterisk/jabber.h @@ -49,6 +49,19 @@ #include "asterisk/astobj.h" #include "asterisk/linkedlists.h" +/* + * As per RFC 3920 - section 3.1, the maximum length for a full Jabber ID + * is 3071 bytes. + * The ABNF syntax for jid : + * jid = [node "@" ] domain [ "/" resource ] + * Each allowable portion of a JID (node identifier, domain identifier, + * and resource identifier) MUST NOT be more than 1023 bytes in length, + * resulting in a maximum total size (including the '@' and '/' separators) + * of 3071 bytes. + */ +#define AJI_MAX_JIDLEN 3071 +#define AJI_MAX_RESJIDLEN 1023 + enum aji_state { AJI_DISCONNECTING, AJI_DISCONNECTED, @@ -82,7 +95,7 @@ struct aji_capabilities { struct aji_resource { int status; - char resource[80]; + char resource[AJI_MAX_RESJIDLEN]; char *description; struct aji_version *cap; int priority; @@ -98,7 +111,7 @@ struct aji_message { }; struct aji_buddy { - ASTOBJ_COMPONENTS(struct aji_buddy); + ASTOBJ_COMPONENTS_FULL(struct aji_buddy, AJI_MAX_JIDLEN, 1); char channel[160]; struct aji_resource *resources; enum aji_btype btype; @@ -116,9 +129,8 @@ struct aji_transport_container { struct aji_client { ASTOBJ_COMPONENTS(struct aji_client); char password[160]; - char user[160]; - char serverhost[160]; - char context[100]; + char user[AJI_MAX_JIDLEN]; + char serverhost[AJI_MAX_RESJIDLEN]; char statusmessage[256]; char sid[10]; /* Session ID */ char mid[6]; /* Message ID */ |