[JDEV] [patch client.c]

Thomas Muldowney temas at box5.net
Tue Mar 6 15:13:28 CST 2001


Thanks for the patch, I'll merge this into the main source tree, thank you
very much.

--temas

On Mon, Mar 05, 2001 at 02:53:26PM +0100, Rodolphe Duge de Bernonville wrote:
> Under heavy load (high connection/disconnection), 
> User authentification may take a few seconds, 
> if the user is disconnected while he is waiting for
> the creation of his session, he will be removed
> from the hashlist of the clients but as his state is 
> not state_AUTHD, he will receive the ack of session
> creation but his session will never receive a typed-error
> route.
> 
> After that, pthsock_client will try to write the ack 
> for authentification, so before writin, you must
> verify that the user is still here (because mio struct has
> been freed .. ooops :).
> 
> 
> 
> 
> @@ -97,13 +97,25 @@
>      if(p->id->user != NULL)
>          fd = atoi(p->id->user); 
>      
> -    if(p->type != p_ROUTE || fd == 0 || (cdcur = ghash_get(s__i->users,
> xmlnode_get_attrib(p->x, "to"))) == NULL)
> +    if(p->type != p_ROUTE || fd == 0)
>      { /* we only want <route/> packets or ones with a valid connection
> */
>          log_warn(p->host, "pthsock_client bouncing invalid %s packet
> from %s", xmlnode_get_name(p->x), xmlnode_get_attrib(p->x,"from"));
>          deliver_fail(p, "invalid client packet");
>          return r_DONE;
>      }
>  
> +
> +    if ((cdcur = ghash_get(s__i->users, xmlnode_get_attrib(p->x,
> "to"))) == NULL){
> +	if (!j_strcmp(xmlnode_get_attrib(p->x, "type"),  "session")){
> +		jutil_tofrom(p->x);
> +		xmlnode_put_attrib(p->x, "type", "error");
> +		deliver(dpacket_new(p->x), s__i->i);
> +        } 
> +	else
> +	    xmlnode_free(p->x);
> +        return r_DONE;
> +    }
> +
>      if (fd != cdcur->m->fd || cdcur->m->state != state_ACTIVE)
>          m = NULL;
>      else if (j_strcmp(p->id->resource,cdcur->res) != 0)
> @@ -177,7 +189,7 @@
>      }
>  
>  
> -    if(xmlnode_get_firstchild(p->x) == NULL)
> +    if(xmlnode_get_firstchild(p->x) == NULL ||  ghash_get(s__i->users,
> xmlnode_get_attrib(p->x, "to")) == NULL)
>      {
>          xmlnode_free(p->x);
>      }
> 
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <https://www.jabber.org/jdev/attachments/20010306/fb93b00b/attachment-0002.pgp>


More information about the JDev mailing list