1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00

Remove unused code (and pstring).

Jeremy.
This commit is contained in:
Jeremy Allison 2007-11-28 14:08:49 -08:00
parent 223352e323
commit a261a61226

View File

@ -113,95 +113,3 @@ bool cli_send_mailslot(struct messaging_context *msg_ctx,
MSG_SEND_PACKET,
(uint8 *)&p, sizeof(p)));
}
/*
* cli_get_response: Get a response ...
*/
bool cli_get_response(const char *mailslot, char *buf, int bufsiz)
{
struct packet_struct *p;
p = receive_unexpected(DGRAM_PACKET, 0, mailslot);
if (p == NULL)
return False;
memcpy(buf, &p->packet.dgram.data[92],
MIN(bufsiz, p->packet.dgram.datasize-92));
return True;
}
/*
* cli_get_backup_list: Send a get backup list request ...
*/
static char cli_backup_list[1024];
int cli_get_backup_list(struct messaging_context *msg_ctx,
const char *myname, const char *send_to_name)
{
pstring outbuf;
char *p;
struct sockaddr_storage sendto_ss;
if (!resolve_name(send_to_name, &sendto_ss, 0x1d)) {
DEBUG(0, ("Could not resolve name: %s<1D>\n", send_to_name));
return False;
}
memset(cli_backup_list, '\0', sizeof(cli_backup_list));
memset(outbuf, '\0', sizeof(outbuf));
p = outbuf;
SCVAL(p, 0, ANN_GetBackupListReq);
p++;
SCVAL(p, 0, 1); /* Count pointer ... */
p++;
SIVAL(p, 0, 1); /* The sender's token ... */
p += 4;
cli_send_mailslot(msg_ctx, True, "\\MAILSLOT\\BROWSE", 1, outbuf,
PTR_DIFF(p, outbuf), myname, 0, send_to_name,
0x1d, &sendto_ss);
/* We should check the error and return if we got one */
/* Now, get the response ... */
cli_get_response("\\MAILSLOT\\BROWSE",
cli_backup_list, sizeof(cli_backup_list));
return True;
}
/*
* cli_get_backup_server: Get the backup list and retrieve a server from it
*/
int cli_get_backup_server(struct messaging_context *msg_ctx,
char *my_name, char *target, char *servername,
int namesize)
{
/* Get the backup list first. We could pull this from the cache later */
cli_get_backup_list(msg_ctx, my_name, target); /* FIXME: Check the response */
if (!cli_backup_list[0]) { /* Empty list ... try again */
cli_get_backup_list(msg_ctx, my_name, target);
}
strncpy(servername, cli_backup_list, MIN(16, namesize));
return True;
}