MCCP through Copyover

From: StormeRider (silk@ici.net)
Date: 07/10/00


I'm wondering about how to (in a clean fashion) keep MCCP compression
through a copyover. If you don't know what I mean, add MCCP support and
then do a copyover. But be prepared to re-login. :)

I've added an extra field to the copyover data to keep track of whether or
not the client supports MCCP. Basically, it stores

        DESC_FLAGGED(d, DESC_CANZLIB) ? 1 : 0

In the copyover data file. Since you don't do telnet option negotiation
when copyover-ing, this is important.

Now, I've re-arranged the copyover code so that it is now:

        sprintf(buf, "Restoring from copyover...\n\r");

        /* create a new descriptor */
        CREATE (d, struct descriptor_data, 1);
        memset ((char *) d, 0, sizeof (struct descriptor_data));
        init_descriptor (d,desc); /* set up various stuff */

        SET_BIT(DESC_FLAGS(d), DESC_CANZLIB);

        /* Write something, and check if it goes error-free */
        if (write_to_descriptor (desc, buf, strlen(buf)) < 0)
        {
           close_socket (d); /* nope */
           continue;
        }

So it is creating the Circle descriptor before sending to the raw file
descriptor. Is this a bad idea? I understand that you want to get rid of
file descriptors that aren't valid anymore as soon as possible, but...
Is this just for performance reasons or are there other good ideas for
doing this?

Obviously I'll need to actually start up the compression again after
setting DESC_CANZLIB and before the write_to_descriptor.

--
StormeRider
Creator of Winds of Storm,      mudhosters.net:4008
Head Coder of The Last Sunrise, thelastsunrise.net:9000


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT