mudFTP problems continued

From: James Turner (turnerjh@XTN.NET)
Date: 09/26/98

(Primarily aimed at Erwin)

I've been playing with mudFTP a bit and I think the problem mentioned
earlier here is in the client.  On occasion it won't send the last
line.  I've not had time to pinpoint the bug exactly, but it is
behaving quite oddly.  Firing up gdb on the client and breaking at the
top of put_file, then immediately continuing when it hits the
breakpoint results in waiting forever for the mud's response (the mud
never receives the last line so it's waiting indefinitely).  Now, if I
trace through it line by line, it works fine.  Very peculiar.  My
hunch is that it's a problem in the low level socket issues, but a
quick glance at them looks fine.

Here's how I can reproduce it on my system: use redit on room 1204's
description, edit the desc, add one line at the end containing a
single character ('1' in my case), hit enter, and save.  I'm using
pico as my editor (which doesn't add a trailing enter).  It comes to a
total of 6 lines.

<goes and debugs a bit>

Okay I've added a "sleep(1);" inside the while loop in the client's
write_mud(), and tried this version with the exact same description --
and it works perfectly.  Immediately using a version without the
sleep() in it causes it to fail; switching again results in success.
Confirming again: I had the mud log the data it receives.  Without the
sleep()'s, the final line (in this case an empty line) isn't sent.
With them, it is sent.

A very peculiar problem.

<goes and debugs more>

Okay I've found the problem.  It's a bug in the interfacing with
Circle, not explicitly in the client or server (or Circle for that
matter).  Here's a demonstration of the root of the issue: run circle
in the foreground, hit ctrl-z, go to a window already connected, hit
enter 50 times, go back, type "fg", and switch back to the client
window.  Circle only responds to one carriage return.  Now, suppose
you have an empty line in the file that is being sent.  It gets
transmitted just as a "\n".  But if there was a line before it, we end
up with two \n's in the buffer, which circle skips over.

I'll poke around and try to get a fix soon; don't have time to spend
more on it right now, but I will soon.

BTW great job otherwise, Erwin :)  I'm very impressed with it :)

James Turner               UIN: 1102038

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST