[Citadel Development] Re: asynch not working

2010-02-24 Thread IGnatius T Foobar
 >If you send a message from Cit client to pidgin the message doesn't arrive. 
  >Got that bit.   
  > 
  >Question. Does the message from Cit client arrive when pidgin sends a new 
  >message to Cit client?   
  
  It should, at least it did when I tested it.
  
  Pidgin should also receive notifications of when another user logs on or off. 
(The buddy will appear or disappear in the list.)  Those notifications are also
received via the async loop.
 


[Citadel Development] Re: asynch not working

2010-02-24 Thread davew
If you send a message from Cit client to pidgin the message doesn't arrive.
Got that bit.  

Question. Does the message from Cit client arrive when pidgin sends a new
message to Cit client?  

   

   
>  Wed Feb 24 2010 08:33:14 EST from   IGnatius T Foobar @ Uncensored 
>Subject: Re: asynch not working
>
>  
>>I made several assumptions on the types of contexts that could be selected
>>on  
>>and which ones to check the fd of after select. Maybe these assumptions are
>> 
>>flawed.
>>
>>What exactly happens to the context when an async message is sent?
>>

>  
>Check out modules/xmpp/xmpp_queue.c arolines 112-119, and serv_xmpp.c line
>109.  A session that is capable of handling async activity indicates so by
>setting CC->is_async to 1.  Then, when another session (or the housekeeping
>loop, or whatever) wants to tell that session that it has asynchronous
>activity to handle, the target session's CC->async_waiting flag is set to 1. 
>
>Now go to sysdep.c, lines 1143-1149.  A session with actual client activity
>will go ahead and run its async loop after handing a client command, BUT
>ALSO, the main server loop needs to check for sessions with both is_async and
>async_waiting set to 1.  If there ar 
>sessions that have both of those flags set to 1, and there's no input
>waiting from the client, the server needs to wake those sessions up and run
>their async handlers WITHOUT first reading and processing a server command. 
>
>I don't yet know why it isn't working now, but it definitely did work
>before.  The test is fairly easy: log in two users, one using Pidgin and the
>other using a Citadel client.  You will notice that Pidgin can send instant
>messages to the Citadel client, but the Citadel client cannot send instant
>messages to Pidgin (because the XMPP service isn't running its async loop). 
>
>Let me know if you need any other information; I'd appreciate it if this
>could be fixed quickly because I am actively working on XMPP right now and
>this is sort of blocking it. 
>
>
>  
>
>
>  

  

 

[Citadel Development] Re: asynch not working

2010-02-24 Thread davew
IG, I'm trying to test this but my pidgin won't connect.  

It reports unknown error.  

In the citserver log I get "Ignoring unknown tag " just before the
connection gets closed.  

   
>  Wed Feb 24 2010 08:33:14 EST from   IGnatius T Foobar @ Uncensored 
>Subject: Re: asynch not working
>
>  
>>I made several assumptions on the types of contexts that could be selected
>>on  
>>and which ones to check the fd of after select. Maybe these assumptions are
>> 
>>flawed.
>>
>>What exactly happens to the context when an async message is sent?
>>

>  
>Check out modules/xmpp/xmpp_queue.c arolines 112-119, and serv_xmpp.c line
>109.  A session that is capable of handling async activity indicates so by
>setting CC->is_async to 1.  Then, when another session (or the housekeeping
>loop, or whatever) wants to tell that session that it has asynchronous
>activity to handle, the target session's CC->async_waiting flag is set to 1. 
>
>Now go to sysdep.c, lines 1143-1149.  A session with actual client activity
>will go ahead and run its async loop after handing a client command, BUT
>ALSO, the main server loop needs to check for sessions with both is_async and
>async_waiting set to 1.  If there ar 
>sessions that have both of those flags set to 1, and there's no input
>waiting from the client, the server needs to wake those sessions up and run
>their async handlers WITHOUT first reading and processing a server command. 
>
>I don't yet know why it isn't working now, but it definitely did work
>before.  The test is fairly easy: log in two users, one using Pidgin and the
>other using a Citadel client.  You will notice that Pidgin can send instant
>messages to the Citadel client, but the Citadel client cannot send instant
>messages to Pidgin (because the XMPP service isn't running its async loop). 
>
>Let me know if you need any other information; I'd appreciate it if this
>could be fixed quickly because I am actively working on XMPP right now and
>this is sort of blocking it. 
>
>
>  
>
>
>  

  

 

[Citadel Development] Re: asynch not working

2010-02-24 Thread davew
Got it.  

Yep, its broken, definately, Now I have that description its obvious.  

To fix the problem with re-used fd-s before contexts got cleaned / removed
and crashing and all that I went to great pains to ensure we only chose
contexts with activity on the fd to bind to. I didn't consider that an async
message wouldn't generate activity on the fd and so the context wouldn't get
bound to (bind_me) and thus the async wouldn't get done.  

I'll fix it now and make sure I don't break it again when the next context
scheduling gets merged in.  

   
>  Wed Feb 24 2010 08:33:14 EST from   IGnatius T Foobar @ Uncensored 
>Subject: Re: asynch not working
>
>  
>>I made several assumptions on the types of contexts that could be selected
>>on  
>>and which ones to check the fd of after select. Maybe these assumptions are
>> 
>>flawed.
>>
>>What exactly happens to the context when an async message is sent?
>>

>  
>Check out modules/xmpp/xmpp_queue.c arolines 112-119, and serv_xmpp.c line
>109.  A session that is capable of handling async activity indicates so by
>setting CC->is_async to 1.  Then, when another session (or the housekeeping
>loop, or whatever) wants to tell that session that it has asynchronous
>activity to handle, the target session's CC->async_waiting flag is set to 1. 
>
>Now go to sysdep.c, lines 1143-1149.  A session with actual client activity
>will go ahead and run its async loop after handing a client command, BUT
>ALSO, the main server loop needs to check for sessions with both is_async and
>async_waiting set to 1.  If there ar 
>sessions that have both of those flags set to 1, and there's no input
>waiting from the client, the server needs to wake those sessions up and run
>their async handlers WITHOUT first reading and processing a server command. 
>
>I don't yet know why it isn't working now, but it definitely did work
>before.  The test is fairly easy: log in two users, one using Pidgin and the
>other using a Citadel client.  You will notice that Pidgin can send instant
>messages to the Citadel client, but the Citadel client cannot send instant
>messages to Pidgin (because the XMPP service isn't running its async loop). 
>
>Let me know if you need any other information; I'd appreciate it if this
>could be fixed quickly because I am actively working on XMPP right now and
>this is sort of blocking it. 
>
>
>  
>
>
>  

  

 

[Citadel Development] Re: asynch not working

2010-02-24 Thread IGnatius T Foobar
 >I made several assumptions on the types of contexts that could be selected on 
  >and which ones to check the fd of after select. Maybe these assumptions are 
  >flawed.   
  > 
  >What exactly happens to the context when an async message is sent?   
  
  Check out modules/xmpp/xmpp_queue.c arolines 112-119, and serv_xmpp.c line 
109. 
A session that is capable of handling async activity indicates so by setting
CC->is_async to 1.  Then, when another session (or the housekeeping loop, or
whatever) wants to tell that session that it has asynchronous activity to 
handle,
the target session's CC->async_waiting flag is set to 1.
  
  Now go to sysdep.c, lines 1143-1149.  A session with actual client activity 
will
go ahead and run its async loop after handing a client command, BUT ALSO, the
main server loop needs to check for sessions with both is_async and 
async_waiting
set to 1.  If there ar
 sessions that have both of those flags set to 1, and there's no input waiting
from the client, the server needs to wake those sessions up and run their async
handlers WITHOUT first reading and processing a server command.
  
  I don't yet know why it isn't working now, but it definitely did work before. 
The test is fairly easy: log in two users, one using Pidgin and the other using 
a
Citadel client.  You will notice that Pidgin can send instant messages to the
Citadel client, but the Citadel client cannot send instant messages to Pidgin
(because the XMPP service isn't running its async loop).
  
  Let me know if you need any other information; I'd appreciate it if this could
be fixed quickly because I am actively working on XMPP right now and this is 
sort
of blocking it.