[JDEV] Source Code of JabberIM
saradhi
saradhi at virnt
Sat Feb 24 05:32:22 CST 2001
Can i get the Source Code of JabberIM Client in C++/VC++????
SARADHI
***** GOD WON'T ASK WHAT YOUR JOB TITLE WAS, BUT WILL ASK IF YOU PERFORMED
YOUR JOB TO THE BEST OF YOUR ABILITY *****
-----Original Message-----
From: jdev-admin at jabber.org [mailto:jdev-admin at jabber.org]
Sent: Tuesday, February 20, 2001 11:30 PM
To: jdev at jabber.org
Subject: jdev digest, Vol 1 #660 - 14 msgs
Send jdev mailing list submissions to
jdev at jabber.org
To subscribe or unsubscribe via the web, visit
http://mailman.jabber.org/listinfo/jdev
or, via email, send a message with subject or body 'help' to
jdev-request at jabber.org
You can reach the person managing the list at
jdev-admin at jabber.org
When replying, please edit your Subject line so it is more specific than
"Re: Contents of jdev digest..."
Today's Topics:
1. Re: RSS-Transport (Peter Saint-Andre)
2. Software plan (Jakob Nanneson)
3. Flash 5 & Jabber question redux (Drash, Jim [EESUS])
4. Auto Account Creation (Michael Bauer)
5. RE: Auto Account Creation (Todd Bradley)
6. Re: Online status on a webpage (Kok Leong)
7. Regarding The Source Code of the Development Server (saradhi)
8. Jabber DevZone News - jer - Win32 Server Port? (Jabber DevZone)
9. [patch users.c] (Rodolphe Duge de Bernonville)
10. [patch mod_presence.c] (Rodolphe Duge de Bernonville)
11. Bug in base_accpet? (Gang Liu)
12. Re: Regarding The Source Code of the Development Server (Peter
Saint-Andre)
13. Re: Regarding The Source Code of the Development Server (Michael
Wilson)
14. [patch client.c] (Rodolphe Duge de Bernonville)
--__--__--
Message: 1
Date: Mon, 19 Feb 2001 11:29:21 -0700
From: Peter Saint-Andre <stpeter at jabber.org>
Organization: http://www.jabber.org/
To: jdev at jabber.org
Subject: Re: [JDEV] RSS-Transport
Reply-To: jdev at jabber.org
Last I heard was this:
http://mailman.jabber.org/pipermail/jdev/2001-February/005035.html
Peter
--
Peter Saint-Andre
stpeter at jabber.org
Robert Temple wrote:
>
> Whats the status of this transport? Is there one that works with 1.4?
> -Robert
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
--__--__--
Message: 2
From: "Jakob Nanneson" <jakob at rum65.com>
To: <jdev at jabber.org>
Date: Mon, 19 Feb 2001 21:08:47 +0100
charset="iso-8859-1"
Subject: [JDEV] Software plan
Reply-To: jdev at jabber.org
Hi.
I have from time to time under a couple of months written a little plan of
how an "instant messenger model icq"-software could look like. What
functions that people wants and so on. I'm very pleased with my work but a
long time I didn't know where to use my thoughts, then I found Jabber - a
great idea, but the software I've seen isn't too good. Somehow I want to
develop a program for the system, but I don't know how... I'm not really in
to that programming thing. But I'll keep checking out Jabber so maybe I'll
be back soon with some questions.
/jakob.
--__--__--
Message: 3
From: "Drash, Jim [EESUS]" <JDrash at EESUS.JNJ.com>
To: "Jabber-Dev (E-mail)" <jdev at mailman.jabber.org>
Date: Mon, 19 Feb 2001 15:58:00 -0500
boundary="----_=_NextPart_001_01C09AB6.A4848ED0"
Subject: [JDEV] Flash 5 & Jabber question redux
Reply-To: jdev at jabber.org
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C09AB6.A4848ED0
Content-Type: text/plain;
charset="iso-8859-1"
I have not seen the answer to this question:
Since Flash 5 and Jabber do different things relative to XML (DOM
vs. SAX, respectively <as I understand it>), would it not be possible to
write a transport for Jabber to handle this stuff? If so, is anyone looking
at this? Please excuse my ignorance, if this has already been asked and
answered. So far, what parts of the mailing list archive I have browsed,
have decried the fact that such a thing did not exist in Jabber already (and
I guess some folks were expecting it in Jabber 1.4).
Thanks in advance,
jim drash
------_=_NextPart_001_01C09AB6.A4848ED0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2654.19">
<TITLE>Flash 5 & Jabber question redux</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2 FACE=3D"Arial">I have not seen the answer to this =
question:</FONT>
</P>
<P> <FONT SIZE=3D2 =
FACE=3D"Arial">Since Flash 5 and Jabber do different things relative to =
XML (DOM vs. SAX, respectively <as I understand it>), would it =
not be possible to write a transport for Jabber to handle this stuff? =
If so, is anyone looking at this? Please excuse my ignorance, if =
this has already been asked and answered. So far, what parts of the =
mailing list archive I have browsed, have decried the fact that such a =
thing did not exist in Jabber already (and I guess some folks were =
expecting it in Jabber 1.4).</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Thanks in advance,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">jim drash</FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C09AB6.A4848ED0--
--__--__--
Message: 4
Date: Mon, 19 Feb 2001 16:53:13 -0700
From: Michael Bauer <bauer at jabber.com>
To: jdev at jabber.org
Subject: [JDEV] Auto Account Creation
Reply-To: jdev at jabber.org
How would you go about automatically creating accounts for all other IM
services (AIM, Yahoo, etc) you don't currently have and to hide them so
a user would never have to know about any other account other than their
Jabber account?
--__--__--
Message: 5
From: Todd Bradley <TBradley at jabber.com>
To: "'jdev at jabber.org'" <jdev at jabber.org>
Subject: RE: [JDEV] Auto Account Creation
Date: Mon, 19 Feb 2001 17:17:47 -0700
charset="iso-8859-1"
Reply-To: jdev at jabber.org
> How would you go about automatically creating accounts for
> all other IM
> services (AIM, Yahoo, etc)
That sounds like a tough one. Since these IM
services generally allow account creation through
a web interface, the only way I can think of to
do that is this:
Look at the web pages to register accounts for
these other IM systems. At some point, there
are probably HTML forms getting submitted. You
could write a script to interact with the IM's
webserver directly and submit those forms with
whatever field values you choose.
This would break whenever Yahoo (or whoever)
changes their web registration. It would also
be illegal, because all the other IM systems
require you to "read" and accept a terms of
service agreement. This script would be im-
personating that user and accepting the terms
on their behalf. I suppose you might get
around that by presenting the new Jabber user
with the terms of service from each of the
other IM systems and have them accept them all
en masse. But I'm no lawyer.
Besides, even if you could legally do this,
you'd probably piss Yahoo (or whoever) off
if you did it without their permission. By
hiding the Yahoo account from the Jabber user,
Yahoo wouldn't be getting any benefit from the
arrangement.
Technically, I suppose one other way to do this
is reverse engineer the other IM protocol to see
the data stream they send to register a new user.
Then, rather than manipulating a web page, you
could write a program to spoof that data stream.
This should be possible with any IM system that
has a standalone client app, unless it requires
you to reply to an email verification or some-
thing. I'd imagine Yahoo would be just as un-
happy at you spoofing a new user registration
data stream as they'd be if you spoofed their
web registration forms.
Todd.
--__--__--
Message: 6
Date: Tue, 20 Feb 2001 08:51:20 +0800
From: Kok Leong <chan.kok.leong at biztone.com>
Organization: Biztone.Com
To: jdev at jabber.org
Subject: Re: [JDEV] Online status on a webpage
Reply-To: jdev at jabber.org
*This message was transferred with a trial version of CommuniGate(tm) Pro*
Lance is right. I want to be able to get presence info for cross-IM JIDs
through
a jabber server ( in this case, it's my own server ) . I won't be able to do
that if I were to only use Robert's solution. IMHO, I could use that
solution if
I were to display online status for MSN-IM IDs and only IDs that I have
added to
my MSN buddy list.
Thanks for both of your suggestions...
"Lance (pyzr)" wrote:
> *This message was transferred with a trial version of CommuniGate(tm) Pro*
> Yeah, im not contending that. But how would you be able to get the status
of
> another user? And its VB script that does that i believe, and can't only
be
> shown in IE. That simply pulls info from some object off your system that
> is controlled by MSN messenger and outputs it into HTML. He wants (or at
> least from what i understood it as) is to get the presence info from any
> JID.. through jabber itself...
>
> -pyzr
>
> -----Original Message-----
> From: jdev-admin at jabber.org [mailto:jdev-admin at jabber.org]On Behalf Of
> Robert Temple
> Sent: Monday, February 19, 2001 11:52 AM
> To: 'jdev at jabber.org'
> Subject: RE: [JDEV] Online status on a webpage
>
> no no. If you go to the msn home page and you sign into msn messenger,
> it shows your buddy list on that home page. It uses the COM object in
> the messenger exe to build that buddy list.
>
> -Robert
>
> -----Original Message-----
> From: Lance Hall [mailto:pyzr at pyzr.com]
> Sent: Monday, February 19, 2001 3:39 AM
> To: jdev at jabber.org
> Subject: RE: [JDEV] Online status on a webpage
>
> I think you mis-understood what he was wanting. What you proposed wouldn't
> get the presence for anyone but yourself.
>
> Check out:
> http://dev.jabber.org/projects/project.trp?id=58
> Its a php script that will log into a jabber server, and can get the
> presence of any JID. It works fine for me. But you have to subscribe to
the
> script obviously... because of the way presence architecture is built. I
had
> proposed a universally accessible presence (basically a namespace that the
> client can choose what the result will be) for situations just like this.
If
> the client does not want his presence accessible through this namespace
then
> that is up to him.. it can be disabled. Since there is no standard yet, i
> created my own namespace for my FusionIM client, for just this purpose.
>
> Lance
>
> -----Original Message-----
> From: jdev-admin at jabber.org [mailto:jdev-admin at jabber.org]On Behalf Of
> Robert Temple
> Sent: Monday, February 19, 2001 3:00 AM
> To: 'jdev at jabber.org'
> Subject: RE: [JDEV] Online status on a webpage
>
> You can do it like MSN messenger does it. In IE, JavaScript accesses the
> Messenger application's COM object and asks it for the status of buddies,
> and the draws them accordingly.
>
> -Robert
>
> -----Original Message-----
> From: Kok Leong [mailto:chan.kok.leong at biztone.com]
> Sent: Sunday, February 18, 2001 7:22 PM
> To: jdev at jabber.org
> Subject: [JDEV] Online status on a webpage
>
> *This message was transferred with a trial version of CommuniGate(tm) Pro*
> Hi,
> I've looked at the archives and did not find anything on how to view a
> user's online status on a webpage. An example would be Yahoo where it
> provides a link to be included in a html page and updates the page (
> showing online or offline icons ) accordingly.
> I could think of using Jabberbeans to interface to the server through a
> servlet and have the servlet generate online status on the html page...
> Is there any other way to do this?
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
--__--__--
Message: 7
From: saradhi <saradhi at virnt>
To: jdev at jabber.org
Date: Tue, 20 Feb 2001 11:11:02 +0530
charset="iso-8859-1"
Subject: [JDEV] Regarding The Source Code of the Development Server
Reply-To: jdev at jabber.org
HI,
How can i get the Source Code in C++/VC++ of the Jabber Server???
Thanks in Advance.
SARADHI
Associative Consultant
Virinchi Consultants Limited
Surabhi Plaza, Vikrampuri,
Secunderabad, A.P. , India
*91 (040) 7890 662 - 665
mail: saradhi at virinchi.com
***** GOD WON'T ASK WHAT YOUR JOB TITLE WAS, BUT WILL ASK IF YOU PERFORMED
YOUR JOB TO THE BEST OF YOUR ABILITY *****
--__--__--
Message: 8
Date: Tue, 20 Feb 2001 00:24:04 -0800
To: jdev at jabber.org
From: Jabber DevZone <webmaster at jabber.org>
Subject: [JDEV] Jabber DevZone News - jer - Win32 Server Port?
Reply-To: jdev at jabber.org
Win32 Server Port?
I've written up some ideas on what it would take to port the current
codebase to win32 at http://core.jabber.org/win32.html. I'd
appreciate any feedback, and would love to find one or more
individuals ready to take on this challenge :)
--__--__--
Message: 9
Date: Tue, 20 Feb 2001 11:22:23 +0100
From: Rodolphe Duge de Bernonville <rod at idealx.com>
Organization: IDEALX S.A.S.
To: jdev at jabber.org
Subject: [JDEV] [patch users.c]
Reply-To: jdev at jabber.org
With asynchronous IO and heavy load, problems
may occure in jsm/users.c.
- js__usercount may be wrong.
- If the xdb_get call to retrieve user name and password is too
long, you can have many calls to ghash_put for the same
user. This will corrupt the udata field in the session struct.
So you must test after the xdb_get call if the user
is already in the cache.
+ finally : this cache and the reference counter was the source of
many problems (see a precedent mail of david, dlecorfec at idealx.com,
he has had to increase this counter in jsm/modules.c in js_mapi_call
). And I have seen that if a session was too long to open (ie when
a _js_session_start is in a mtq), it may happen that the udata
struct was deleted ... so I have put a
s->u->ref++; in js_session_new
and a
s->u->ref--; in _js_session_start
and finally to avoid that, I have decided that for a user with a session
the entry in this cache is permanent until he leave ...
so just put a
s->u->ref--; in _js_session_end
@@ -57,7 +57,12 @@
* is positive, or if there are active sessions
* we can't free it, so return immediately
*/
- if(u->ref > 0 || (u->sessions != NULL && ++js__usercount))
+ if (u->sessions != NULL){
+ js__usercount++;
+ return 1;
+ }
+
+ if(u->ref > 0)
return 1;
log_debug(ZONE,"freeing %s",u->user);
@@ -114,11 +132,11 @@
udata js_user(jsmi si, jid id, HASHTABLE ht)
{
pool p;
- udata cur, newu;
- char *ustr;
+ udata cur, newu, tmpu = NULL;
+ char *ustr, *u;
xmlnode x;
jid uid;
-
+
if(si == NULL || id == NULL || id->user == NULL) return NULL;
/* get the host hash table if it wasn't provided */
@@ -158,9 +179,14 @@
newu->id = jid_new(p,jid_full(uid));
/* got the user, add it to the user list */
- ghash_put(ht,newu->user,newu);
+ if ((tmpu=ghash_get(ht, u)) == NULL)
+ ghash_put(ht,newu->user,newu);
+ else{
+ pool_free(p);
+ newu = tmpu;
+ }
+
log_debug(ZONE,"js_user debug %X
%X",ghash_get(ht,newu->user),newu);
return newu;
}
-
--__--__--
Message: 10
Date: Tue, 20 Feb 2001 11:41:42 +0100
From: Rodolphe Duge de Bernonville <rod at idealx.com>
Organization: IDEALX S.A.S.
To: jdev at jabber.org
Subject: [JDEV] [patch mod_presence.c]
Reply-To: jdev at jabber.org
Under heavy load and for an unknow reason (for the moment :)
_js_session_end may be call before a last call to mod_presence.
this will free the pres field in the session struct via
xmlnode_free(s->presence)
which will cause many problems in the mod_presence module in
the mod_presence_out call.
I think it is because of the xdb_get call to have the roster.
So, for the moment, (it works but not very nice), after each xdb call
in this function, I recommend to do that :
/* push to roster subscriptions */
roster = xdb_get(m->si->xc, m->user->id, NS_ROSTER);
/* WARNING : possible to have s->presence modify by js_session_end */
if (m->s->exit_flag == 1){
xmlnode_free(m->packet->x);
xmlnode_free(roster);
return M_HANDLED;
}
--__--__--
Message: 11
Date: Tue, 20 Feb 2001 20:37:23 +0800
From: Gang Liu <gang_l at 21cn.com>
Reply-To: gang_l at 21cn.com
To: "jdev at jabber.org" <jdev at jabber.org>
Subject: [JDEV] Bug in base_accpet?
Reply-To: jdev at jabber.org
Hi,
I use base_accpet to setup xdb_file in another linux box. Jabber
server is 1.4 release.Linux is RedHat 6.1.But jabberd often hang up in xdb
request.I also use tcpdump to see network traffic.When jabberd do something
like below, nothing is captured by tcpdump.
Thanks for your help.
Tue Feb 20 20:24:00 2001 deliver.c:460 DELIVER 2:vista.internal <xdb
type='get'
to='amx at vista.internal' from='sessions' ns='jabber:iq:roster' id='61'/>
Tue Feb 20 20:24:00 2001 deliver.c:649 delivering to instance
'xdb.vista.intern
al'
Tue Feb 20 20:24:00 2001 mio.c:898 mio_write called on x: 81D4850 buffer:
(null
)
Tue Feb 20 20:24:00 2001 xdb.c:201 xdb_get() waiting for amx at vista.internal
jab
ber:iq:roster
Tue Feb 20 20:24:15 2001 users.c:82 checking users for host vista.internal
Tue Feb 20 20:24:15 2001 usercount 1 total users
Tue Feb 20 20:24:19 2001 deliver.c:460 DELIVER 2:vista.internal <xdb
type='get'
to='amx at vista.internal' from='sessions' ns='jabber:iq:roster' id='61'/>
Tue Feb 20 20:24:19 2001 deliver.c:649 delivering to instance
'xdb.vista.intern
al'
Tue Feb 20 20:24:19 2001 mio.c:898 mio_write called on x: 81FC930 buffer:
(null
)
Tue Feb 20 20:24:30 2001 deliver.c:460 DELIVER 2:vista.internal <xdb
type='get'
to='amx at vista.internal' from='sessions' ns='jabber:iq:roster' id='61'/>
Tue Feb 20 20:24:30 2001 deliver.c:649 delivering to instance
'xdb.vista.intern
al'
Tue Feb 20 20:24:30 2001 mio.c:898 mio_write called on x: 81F8D00 buffer:
(nu
Jabber Server config:
....
<xdb id="xdb.vista.internal">
<host/>
<accept>
<ip/>
<port>5280</port>
<secret>secret</secret>
</accept>
</xdb>
....
xdb_file config:
<jabber>
<service id="xdb.vista.internal">
<host/>
<connect>
<ip>192.168.0.1</ip>
<port>5280</port>
<secret>secret</secret>
</connect>
</service>
<log id='xdblog'>
<host/>
<format>%d: [%t] (%h): %s</format>
<file>./xdb-error.log</file>
<stderr/>
</log>
<xdb id="xdb_handler">
<host>vista.internal</host>
<load><xdb_file>./xdb_file/xdb_file.so</xdb_file></load>
<xdb_file
xmlns="jabber:config:xdb_file"><spool>./spool</spool></xdb_file>
</xdb>
</jabber>
Regards,
- Lg
2001-2-20 20:22:14
--
Gang Liu / Vista Team / ShenZhen City / China
Email: gang_l at 21cn.com & gang_l at hotmail.com
Phone: +86 13923425035
ICQ: 70670666 Jabber: gang_l at jabber.org
--__--__--
Message: 12
Date: Tue, 20 Feb 2001 06:32:45 -0700
From: Peter Saint-Andre <peter at saint-andre.com>
To: jdev at jabber.org
Subject: Re: [JDEV] Regarding The Source Code of the Development Server
Reply-To: jdev at jabber.org
As discussed here ...
http://docs.jabber.org/no-sgml/faq.trp#language
... the core server is written in C.
Peter
saradhi wrote:
> HI,
> How can i get the Source Code in C++/VC++ of the Jabber Server???
> Thanks in Advance.
> SARADHI
> Associative Consultant
> Virinchi Consultants Limited
> Surabhi Plaza, Vikrampuri,
> Secunderabad, A.P. , India
> *91 (040) 7890 662 - 665
> mail: saradhi at virinchi.com
>
> ***** GOD WON'T ASK WHAT YOUR JOB TITLE WAS, BUT WILL ASK IF YOU
PERFORMED
> YOUR JOB TO THE BEST OF YOUR ABILITY *****
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
--__--__--
Message: 13
Date: Tue, 20 Feb 2001 13:37:45 +0000
From: Michael Wilson <mwilson at myopenapps.com>
Organization: MyOpenApps.com (Insight ASP)
To: jdev at jabber.org
Subject: Re: [JDEV] Regarding The Source Code of the Development Server
Reply-To: jdev at jabber.org
Peter Saint-Andre wrote:
> As discussed here ...
Well, stated anyway. I don't question the decision to implement in
C; doubtless it made sense given the requirements and skills
available. Still it would be nice to hear /why/ C was chosen instead
of C++ or something more RAD-friendly. Since the focus of Jabber
is design simplicity and functionality rather than raw performance I
wouldn't have been suprised if it was written in Python ;>
+--
| Michael Wilson "Smart Applications - Tools for life"
| Java Developer available @
| Insight ASP LTD http://www.myopenapps.com
+----------------------Open Source Innovation-----------------------
--__--__--
Message: 14
Date: Tue, 20 Feb 2001 15:42:33 +0100
From: Rodolphe Duge de Bernonville <rod at idealx.com>
Organization: IDEALX S.A.S.
To: jdev at jabber.org
Subject: [JDEV] [patch client.c]
Reply-To: jdev at jabber.org
In pthsock/client.c
The jabber server may be overloaded by a user who
send big xml tag or data.
Furthermore when a user has not sent his username/password,
he can send request that are bufferized inside client.c.
This should be limited to 10 requests before being disconnected
(auth, presence, roster, filter, agents ...). This would
avoid high intensive memory and cpu (when the user send his
user/password)
usage.
Patch for the first part :
--- jabber2/jabberd/lib/lib.h Thu Feb 1 22:21:43 2001
+++ ../MODIF/jabber2/jabberd/lib/lib.h Tue Feb 20 15:10:57 2001
@@ -557,6 +557,7 @@
KARMA_HEARTBEAT seconds */
#define KARMA_PENALTY -5 /* where you go when you hit 0 karma */
#define KARMA_RESTORE 5 /* where you go when you payed your penelty or
INIT */
+#define MAXNODESIZE 8192
struct karma
{
@@ -566,6 +567,8 @@
int inc,dec; /* how much to increment/decrement */
int penalty,restore; /* what penalty (<0) or restore (>0) */
time_t last_update; /* time this was last incremented */
+ int maxnodesize;
+ int conf_maxnodesize;
};
struct karma *karma_new(pool p); /* creates a new karma object, with
default values */
--- jabber2/jabberd/mio_xml.c Thu Jan 18 08:43:40 2001
+++ ../MODIF/jabber2/jabberd/mio_xml.c Tue Feb 20 15:17:06 2001
@@ -29,6 +29,8 @@
*
--------------------------------------------------------------------------*/
#include <jabberd.h>
+extern xmlnode greymatter__;
+
/* *******************************************
* Internal Expat Callbacks
@@ -83,6 +85,8 @@
}
m->stacknode = parent;
}
+
+ m->k.maxnodesize = 0;
}
void _mio_xstream_CDATA(mio m, const char* cdata, int len)
@@ -118,8 +122,26 @@
void _mio_xml_parser(mio m, const void *buf, size_t bufsz)
{
/* init the parser if this is the first read call */
- if(m->parser == NULL)
- _mio_xstream_init(m);
+ if(m->parser == NULL){
+ xmlnode io = xmlnode_get_tag(greymatter__, "io");
+
+ m->k.maxnodesize = 0;
+ m->k.conf_maxnodesize = j_atoi(xmlnode_get_data(xmlnode_get_tag(io,
"maxnodesize")), MAXNODESIZE);
+ _mio_xstream_init(m);
+ }
+
+ if ( (m->k.maxnodesize += bufsz) > m->k.conf_maxnodesize){
+ if(m->cb != NULL)
+ {
+ (*(mio_std_cb)m->cb)(m, MIO_ERROR, m->cb_arg);
+ mio_write(m, NULL, "<stream:error>Invalid
XML</stream:error>", -1);
+ mio_close(m);
+ }
+
+ return;
+ }
+
+ fprintf(stderr, "_mio_xml_parser : m->k.maxnodesize : %d\n",
m->k.maxnodesize );
if(XML_Parse(m->parser, buf, bufsz, 0) == 0)
if(m->cb != NULL)
@@ -129,3 +151,4 @@
mio_close(m);
}
}
+
--- jabber2/pthsock/client.c Sat Feb 3 23:46:57 2001
+++ ../MODIF/jabber2/pthsock/client.c Tue Feb 20 15:32:41 2001
@@ -44,6 +44,7 @@
#include <jabberd.h>
#define DEFAULT_AUTH_TIMEOUT 0
+#define MAX_REQ_BEFORE_AUTH 10
/* socket manager instance */
typedef struct smi_st
@@ -54,6 +55,7 @@
HASHTABLE users;
xmlnode cfg;
char *host;
+ int nreqbeforeauth;
} *smi, _smi;
typedef enum { state_UNKNOWN, state_AUTHD } user_state;
@@ -303,6 +305,10 @@
q = pmalloco(xmlnode_pool(x), sizeof(_mio_wbq));
q->x = x;
pth_msgport_put(cd->pre_auth_mp, (void*)q);
+ if (pth_msgport_pending(cd->pre_auth_mp) >
cd->si->nreqbeforeauth){
+ mio_write(m, NULL, "<stream:error>Too many
requests</stream:error></stream:stream>", -1);
+ mio_close(m);
+ }
return;
}
else if (NSCHECK(q, NS_AUTH))
@@ -434,6 +440,8 @@
s__i->cfg = xdb_get(xc, jid_new(xmlnode_pool(x),
"config at -internal"), "jabber:config:pth-csock");
s__i->host = host = i->id;
+ s__i->nreqbeforeauth =
j_atoi(xmlnode_get_data(xmlnode_get_tag(s__i->cfg, "nreqbeforeauth")),
MAX_REQ_BEFORE_AUTH);
+
k.val =KARMA_INIT;
k.bytes = 0;
--__--__--
_______________________________________________
jdev mailing list
jdev at jabber.org
http://mailman.jabber.org/listinfo/jdev
End of jdev Digest
More information about the JDev
mailing list