11 Jan, 2012, thecircuitbox wrote in the 1st comment:
Votes: 0
My objective is KaVir gui snippet with mccp.

Output of make.
make
make ../bin/circle
make[1]: Entering directory `/home/fubar/Desktop/HackThePlanet/src'
gcc -g -O2 -Wall -c -o act.wizard.o act.wizard.c
act.wizard.c: In function do_copyover:
act.wizard.c:4057:6: error: too few arguments to function write_to_descriptor
comm.h:48:5: note: declared here
act.wizard.c:4065:43: error: expected expression before struct
act.wizard.c:4065:43: error: too few arguments to function write_to_descriptor
comm.h:48:5: note: declared here
make[1]: *** [act.wizard.o] Error 1
make[1]: Leaving directory `/home/fubar/Desktop/HackThePlanet/src'
make: *** [all] Error 2


comm.h
int	write_to_descriptor(socket_t desc, const char *txt, struct compr *comp);


act.wizard.c
write_to_descriptor (d->descriptor, "\n\rSorry, we are rebooting. Come back in a few minutes.\n\r");
write_to_descriptor (d->descriptor, buf);


It says I need another argument to function which i am taking is something like d->scriptor/buf. Is that right?
11 Jan, 2012, Kaz wrote in the 2nd comment:
Votes: 0
Seems obvious. Your write_to_descriptor takes a third parameter, whereas the one that the snippet was for had only two. Have a look at some other examples of write_to_descriptor in your own codebase, and look to see what they do.
11 Jan, 2012, KaVir wrote in the 3rd comment:
Votes: 0
Neither of those two code blocks are related to my snippet.

I'm guessing the compr struct contains compression data? Did you add an MCCP snippet as well? If you've added another argument to write_to_descriptor() then you'll have to update it everywhere, but that doesn't seem like a very good idea. What snippet is it from?
11 Jan, 2012, thecircuitbox wrote in the 4th comment:
Votes: 0
MCCP snippet off the tbaMud website. I am using tbaMud_with_protocol. And yeah your snippet had nothing todo with the error.
11 Jan, 2012, Rarva.Riendf wrote in the 5th comment:
Votes: 0
I implemented mccp within Kavir Snipet so if you are stuck I can send you all I did for it. Though I dont think I actually bothered to modify anything in copyover as I do not use it
11 Jan, 2012, thecircuitbox wrote in the 6th comment:
Votes: 0
That would be sweet, I have been using copyover but im doing minor changes.
I think if you use mccp during copyover it will disconnect you when using compression.
Or if you are not using compression it may be fine. But I have not tested this just a theory.

make
make ../bin/circle
make[1]: Entering directory `/home/fubar/Desktop/HackThePlanet/src'
gcc -g -O2 -Wall -c -o comm.o comm.c
comm.c: In function copyover_recover:
comm.c:408:27: warning: d may be used uninitialized in this function
gcc -g -O2 -Wall -c -o protocol.o protocol.c
protocol.c: In function Write:
protocol.c:44:4: warning: format not a string literal and no format arguments
protocol.c: In function ReportBug:
protocol.c:49:4: warning: format not a string literal and no format arguments
protocol.c: In function PerformHandshake:
protocol.c:1316:13: error: COMPRESS_START undeclared (first use in this function)
protocol.c:1316:13: note: each undeclared identifier is reported only once for each function it appears in
protocol.c:1318:13: error: COMPRESS_End undeclared (first use in this function)
make[1]: *** [protocol.o] Error 1
make[1]: Leaving directory `/home/fubar/Desktop/HackThePlanet/src'
make: *** [all] Error 2


I also went through and did various arguments. To fix the comm.c errors, I came up with these. I am using d->comp atm which I think is causing the *d warning. Below is what I check out that would work. NULL I believe does not cause the *d warning.
t->comp - no
NULL - Yes
comp->stream - no
struct compr - no
d->comp - yes
comp - no
struct compr *comp - no


COMPRESS_start/end have not been change and I know that it needs to be change. I am not worried about that. I am just worried about the warning for *d. Line code for it:
struct descriptor_data *d;
12 Jan, 2012, Rarva.Riendf wrote in the 7th comment:
Votes: 0
Give me your Email I will send you all the files needed to activate mccp so you can see what is missing in your code.
14 Jan, 2012, thecircuitbox wrote in the 8th comment:
Votes: 0
lol, I can say for sure that i am stuck.

Here is the patch I was using: mccp_patch
15 Jan, 2012, Sharmair wrote in the 9th comment:
Votes: 0
You are not very clear on what your problem is, but to address some of the
things that have been mentioned in this thread:

In the first post, you had an issue with the write_to_descriptor function in
act.wizard.c needing another argument. When you added the MCCP snippet,
it added a compression structure to your descriptor_data structure. That
struct is then added as an argument to the write_to_descriptor (and the
perform_socket_write) function. Since you will want to send the comp
member from the same descriptor_data struct as the socket (the descriptor
member of the descriptor_data struct), the lines:
write_to_descriptor (d->descriptor, "\n\rSorry, we are rebooting. Come back in a few minutes.\n\r");
write_to_descriptor (d->descriptor, buf);

would be changed to:
write_to_descriptor (d->descriptor, "\n\rSorry, we are rebooting. Come back in a few minutes.\n\r", d->comp);
write_to_descriptor (d->descriptor, buf, d->comp);

The point is in that case, the d-> part is the same in the 1st and 3rd arguments.

Later you had an issue with an uninitialized use of d. When you define a variable
in a function like you are here, the value of the variable starts out as whatever
just happends to be in the memory location used for the variable, and is probably
invalid. So, the first thing you should be doing is writing valid data to it. The
warning comes from you reading (and using) the value before it is initialized with
valid data. You did not show any code for this part, so I am not sure what name
is used for the descriptor_data struct (if it is not just using a raw socket here).

Also, the snippet you mentioned does not seem to handle copyover at all, so
more will have to be added there anyway. In short, you will either turn off
compression before copyover and then request again on restart or have copyover
save and restore the compression state through the copyover.
0.0/9