diff --git a/src/server/slavefuncs.c b/src/server/slavefuncs.c --- a/src/server/slavefuncs.c +++ b/src/server/slavefuncs.c @@ -836,25 +836,15 @@ int login_user(char *username) } /** - Sends the server a single request (see protocol.h) - ohnobinki: This should hopefully work, maybe ;D + * Sends the server a single request (see protocol.h) + * ohnobinki: This should hopefully work, maybe ;D + * + * @deprecated THIS FUNCTION SHOULD DIE VERY, VERY SOON! + * (and painfully :-p) */ int sendSignal(struct remoteio *rem, char signal) { - size_t written; - size_t towrite; - char *ssignal; - - _distren_asprintf(&ssignal, "%c", signal); - towrite = strlen(ssignal); - while( towrite - && !remoteio_write(rem, ssignal, towrite, &written)) - { - fprintf(stderr, "Sending request...\n"); - towrite -= written; - } - if(written) - return 0; + remoteio_write(rem, &signal, 1); /** if remoteio_write returned 1, the connection @@ -864,33 +854,24 @@ int sendSignal(struct remoteio *rem, cha } /** - Sends the server an extended signal (request + data) - ohnobinki: I have no clue how you really want to handle this. Please clarify/edit -*/ + * Sends the server an extended signal (request + data) + * ohnobinki: I have no clue how you really want to handle this. Please clarify/edit + * normaldotcom: I see more and more how clueless you are, I hope to get to his soon ;-) + * + * @deprecated lol + */ int sendExtSignal(struct remoteio *rem, char signal, char *data) { - size_t written; - size_t towrite; + size_t len; char *ssignal; /** - Just append the data FIXME: We should do this differently - */ + * Just append the data FIXME: We should do this differently + */ _distren_asprintf(&ssignal, "%c%s", signal, data); - towrite = strlen(ssignal); - while( towrite - && !remoteio_write(rem, ssignal, towrite, &written)) - { - fprintf(stderr, "Sending request...\n"); - towrite -= written; - } - if(written) - return 0; + len = strlen(ssignal); + remoteio_write(rem, ssignal, len); - /** - if remoteio_write returned 1, the connection - is probably dead or there was a real error - */ - return 1; + return 0; }