[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Bug reports
. . -> [Subject]  MUSHclient may disconnect before all output has been received

MUSHclient may disconnect before all output has been received

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1 2  3  

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Thu 20 Aug 2009 08:23 AM (UTC)
Message
I'm currently using MUSHclient v4.43. The problem is what when you disconnect from Achaea, it sends some "goodbye" text right before you're disconnected. The next time I connect (during the same MUSHclient session), that "goodbye" text is still clogging the pipes, and it's output along with the title screen:


You grow still and begin to silently pray for preservation of your soul while you are out of the land.
2614h, 3078m, 13905e, 17178w, 45% exk-
--- Disconnected on Wednesday, August 19, 2009, 9:33 PM ---
--- Connected for 0 days, 2 hours, 3 minutes, 15 seconds. ---

--- Connected on Thursday, August 20, 2009, 12:28 AM ---


You feel your insides clench as your soul is frozen.
You have played 4095 games.

Goodbye for now!
Rapture Runtime Environment v2.1.3 -- (c) 2007 -- Iron Realms Entertainment
Multi-User License: 100-0000-000

           ******************************************

                 Achaea, Dreams of Divine Lands

                 "Your fate and fame shall be
               an echo and a light unto eternity."

           ******************************************

           Achaea's IP address is 64.127.116.163
           For general questions e-mail support@achaea.com.
           151 adventurers are currently in the realms.

           1. Enter the game.
           2. Create a new character.
           3. Quit.

Enter an option or enter your character's name. 

Password correct. Welcome to Achaea.


I haven't looked at the source, but it seems to me like maybe MUSHclient isn't doing a final check of the socket before it closes it? Or something else.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 20 Aug 2009 08:45 AM (UTC)
Message
Final check? It looks a bit like the "socket closed" event has arrived before the final text, however it is interesting that it appears to arrive 4 hours later. Couldn't sleep huh? Playing games at 12:28 am? I know what that's like. ;) With me it is more like 3 am.

I'm not sure if this is a MUSHclient issue or a Winsock one. Just to test for me, can you try to do this later ... but with telnet or some other client. Just reproduce the situation, and see what happens.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #2 on Thu 20 Aug 2009 08:53 AM (UTC)

Amended on Thu 20 Aug 2009 08:55 AM (UTC) by Twisol

Message
Telnet log:


Rapture Runtime Environment v2.1.3 -- (c) 2007 -- Iron Realms Entertainment
Multi-User License: 100-0000-000

           ******************************************

                 Achaea, Dreams of Divine Lands

                 "Your fate and fame shall be
               an echo and a light unto eternity."

           ******************************************

           Achaea's IP address is 64.127.116.163
           For general questions e-mail support@achaea.com.
           123 adventurers are currently in the realms.

           1. Enter the game.
           2. Create a new character.
           3. Quit.

Enter an option or enter your character's name. What is your password? Password
correct. Welcome to Achaea.
Your last login was from domain: censored

Your moss tattoo tingles slightly.
There are elections or referendums that you have not yet voted in.
Type ELECTIONS or REFERENDUMS to list the elections or referendums that you may
participate in.

*------------------( Announcements from the Administration )------------------*
-> A Mayan crown bonus sale is in effect! See Announce #3033.
*-----------------------------------------------------------------------------*
 (Type ADMINMESSAGE to view this again at any time.)

Glade of Isolation.
A comforting feeling of privacy pervades the area. Wings flaring, a pegasus toss
es his regal head impatiently.
You see exits leading north, northeast, east, south, west, and northwest.
2614h, 3078m, 13905e, 17190w ex-
-=[ Help us grow by voting for us at TopMudSites! http://www.achaea.com/vote ]=-
2614h, 3078m, 13905e, 17190w ex-
----[ Sylvans House announcement ]----
Just a friendly reminder...be sure to check your messages when you've been out o
f the realms. You never know who's written to you while you've slept! MSGS will
show your list of messages, MSG READ (message number) to read a particular messa
ge. STAT will also show if you've got new messages. (HELP MESSAGES for a full li
st of what you can do with them)
--------------------------------------
2614h, 3078m, 13905e, 17190w ex-You grow still and begin to silently pray for pr
eservation of your soul while you are out of the land.
2614h, 3078m, 13905e, 17190w ex-
----[ Oakstone announcement ]----
With continued mass extermination and widespread arson, replanting should cease
until further notice. See oakstone news 2693.    We are also looking for a new H
igh Fion.  If you are interested please send the Hierophants a message.  Combat
Ability is important, but leadership is more important.  We need to reactivate a
n under utilized defense.
---------------------------------
2614h, 3078m, 13905e, 17190w ex-
You feel your insides clench as your soul is frozen.
You have played 4097 games.

Goodbye for now!


Connection to host lost.

Press any key to continue...


It also works as expected with IRE's Nexus (1) and Fmud (2) clients.

(1) http://www.achaea.com/nexus
(2) http://www.achaea.com/flash


EDIT: Also, telnet is horrible. Never subjugate me to that tortute again. ;_;

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Thu 20 Aug 2009 09:04 PM (UTC)
Message
Hmm, well in my tests on my local server, I don't get that anomaly. However I have changed the code slightly in 4.44 to attempt to do one last "packet receive" in the process of closing the socket. Perhaps that will help.

I don't really see how the server does it ... does it close the socket (hence the close message) and then send out one final message? Sounds unlikely. But in that case how come the close event arrives at MUSHclient before the last message?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Rakon   USA  (123 posts)  [Biography] bio
Date Reply #4 on Sun 23 Aug 2009 02:13 PM (UTC)
Message
I'm unsure on how this happens when playing Achaea.
However, for the entire time I've used MUSHclient to play Achaea, I've never seen that 'final goodbye' on logout. However, I DO see it when connecting via straight telnet, or the nexus client as stated before.

Been using MUSH since pre V3.2 :P so, it's a bug that's been there a while.

Yes, I am a criminal.
My crime is that of curiosity.
My crime is that of judging people by what they say and think, not what they look like.
My crime is that of outsmarting you, something that you will never forgive me for.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #5 on Sun 23 Aug 2009 07:56 PM (UTC)
Message
Rakon said:

Been using MUSH since pre V3.2 :P so, it's a bug that's been there a while.


Yeah, for the longest time I had completely forgotten about it. It's been like this for a while.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #6 on Mon 24 Aug 2009 11:33 AM (UTC)
Message
Do you use MCCP? From what I recall, this problem was caused by the compression of the text.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #7 on Mon 24 Aug 2009 07:44 PM (UTC)

Amended on Mon 24 Aug 2009 07:53 PM (UTC) by Twisol

Message
Interesting. Yes, it seems to show up fine after I disable compression.


EDIT: I had someone else test with compression enabled/disabled on other clients, like zMUD, GMUD, and SimpleMU, and I'm told they all work on all counts. It seems, then, that this MUSHclient bug has something to do with how MCCP is handled at EOF?

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #8 on Mon 24 Aug 2009 09:52 PM (UTC)
Message
Well that narrows it down, but after staring at the code that handles EOF on decompression, I can't see the problem. Also, it works for me under SmaugFUSS, which uses MCCP.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #9 on Thu 28 Jan 2010 07:16 PM (UTC)

Amended on Thu 28 Jan 2010 07:17 PM (UTC) by Nick Gammon

Message
Twisol said:

Interesting. Yes, it seems to show up fine after I disable compression.


EDIT: I had someone else test with compression enabled/disabled on other clients, like zMUD, GMUD, and SimpleMU, and I'm told they all work on all counts. It seems, then, that this MUSHclient bug has something to do with how MCCP is handled at EOF?


Back to this for a bit, this is unsolved AFAIK and it is interesting to read Worstje's commments here:

http://www.gammon.com.au/forum/?id=10026

Referring to the MCCP implementation he says:

Worstje said:

Oh, one thing though... Make sure you flush the stream when you know output won't be immediately following anymore, for example after you echo'd a prompt. Otherwise it can be partially stuck in the decompression buffer for a while leading to an odd playing experience where lines sometimes don't show up or take ages to show up. :)


When I first investigated this bug I thought maybe the MCCP buffer was not flushed, particularly as you report that the problem only occurs with MCCP enabled. However on *decompression* I made sure that the Z_SYNC_FLUSH flag was set, which forces as much decompression as possible to occur. Also the zLib library says as follows:

zLib docs said:

In this implementation, inflate() always flushes as much output as possible to the output buffer, and always uses the faster approach on the first call.


So, decompression should be working OK. But what about the server end? Reading Worstje's comment above makes me think that perhaps the fault is at the Achaea end. After all, testing with my local SmaugFuss server does not reproduce the problem, so we have the fact the MUSHclient works OK with Smaug, works OK with compression off, but loses a bit of data with Achaea (data which shows up later).

Now you said you "are told" that zMUD, GMUD, and SimpleMU work with Achaea and MCCP turned on. However for one thing, Wikipedia claims that GMUD does not support MCCP (this might be old), so I wonder quite how accurate these claims are. Do these clients *really* support MCCP, and was it *really* turned on? It may be hard to tell without inspecting the packets in some way.

http://en.wikipedia.org/wiki/Comparison_of_MUD_clients

Also it is possible a single test may not show the problem up. If the server does not set the "flush" parameter when compressing for MCCP, then depending on what is left over in the buffer you may lose a small amount, a large amount, or nothing.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #10 on Thu 28 Jan 2010 07:31 PM (UTC)

Amended on Thu 28 Jan 2010 07:32 PM (UTC) by Nick Gammon

Message
Regarding the subject line "MUSHclient may disconnect before all output has been received" - let's remember that the disconnection is initiated by the server in your example (since it says "Goodbye for now!"). I presume you typed "quit", although you don't seem to be echoing output.

Thus it isn't factually correct to say "MUSHclient disconnects" - it is the server that disconnects in this case. And it doesn't make sense to suggest the server first disconnects, and then sends more output (which MUSHclient somehow doesn't receive). After all, the server cannot disconnect, and then send data.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #11 on Thu 28 Jan 2010 07:46 PM (UTC)
Message
A search for this issue brings up this interesting post from the zMud forums, subject "Achaea-MCCP Compression Error, and Logoff."

Quote:

Also, when I log off, I never get the ending, the part that says Thank you for playing, you have played x number of times.


Now this is an old post (around 2005) but it seems the problem is not totally all related to MUSHclient.

Also Zugg replies:

Zugg said:

The logoff problem is a known issue in zMUD. If the MUD places pain uncompressed text in the same packet as compressed text, then the uncompressed text doesn't get displayed and processed before it gets the logoff message.


Now this is an interesting clue. Perhaps Achaea turns compression off (Zugg seems to be suggesting this is the case) during the logoff procedure, and the final messages may arrive uncompressed. I'll have to check if MUSHclient gracefully handles the switchback from compressed to uncompressed in a single packet.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #12 on Thu 28 Jan 2010 07:57 PM (UTC)
Message
Well, it should handle it. In doc.cpp are these lines:


    // if end of stream, turn decompression off
    if (iCompressResult == Z_STREAM_END)
      {    // we can stop decompressing
      m_bCompress = false;
      // put remaining stuff back into buff
      memcpy (buff, m_zCompress.next_in, m_zCompress.avail_in);
      count = m_zCompress.avail_in;
      }   // end of Z_STREAM_END


That looks for the Z_STREAM_END return code (end of compression), puts the rest of the buffer back, and then loops back to process it uncompressed.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #13 on Thu 28 Jan 2010 09:25 PM (UTC)

Amended on Thu 28 Jan 2010 09:39 PM (UTC) by Twisol

Message
I'll point one of the admins to this page, see if maybe we can figure out what's going on. Thanks for looking more into it!

EDIT: It also occurs to me that I didn't see the text when I quit from Mudlet* recently, either.


* (I was on Linux, it made more sense!)

EDIT 2: It may also be worth noting that in 4.45 (which I'm still running currently), the lines mentioned in the original post don't appear at all after reconnecting, which implies that the original socket flush fix is doing something.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #14 on Sat 06 Feb 2010 08:38 PM (UTC)
Message
I don't know what voodoo you did, Nick, but 4.48 doesn't have this problem... I upgraded straight from 4.46, so I don't know if 4.47 was also clear, unfortunately.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


78,878 views.

This is page 1, subject is 3 pages long: 1 2  3  [Next page]

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]