mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
s3: Remove unused receive_packet
This commit is contained in:
parent
a2970dfaef
commit
7eedf69bc9
@ -2727,7 +2727,6 @@ void make_nmb_name( struct nmb_name *n, const char *name, int type);
|
||||
bool nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
|
||||
int build_packet(char *buf, size_t buflen, struct packet_struct *p);
|
||||
bool send_packet(struct packet_struct *p);
|
||||
struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
|
||||
bool match_mailslot_name(struct packet_struct *p, const char *mailslot_name);
|
||||
int matching_len_bits(unsigned char *p1, unsigned char *p2, size_t len);
|
||||
void sort_query_replies(char *data, int n, struct in_addr ip);
|
||||
|
@ -20,7 +20,6 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "../lib/util/select.h"
|
||||
|
||||
static const struct opcode_names {
|
||||
const char *nmb_opcode_name;
|
||||
@ -1100,38 +1099,6 @@ bool send_packet(struct packet_struct *p)
|
||||
return(send_udp(p->send_fd,buf,len,p->ip,p->port));
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Receive a packet with timeout on a open UDP filedescriptor.
|
||||
The timeout is in milliseconds
|
||||
***************************************************************************/
|
||||
|
||||
struct packet_struct *receive_packet(int fd,enum packet_type type,int t)
|
||||
{
|
||||
fd_set fds;
|
||||
struct timeval timeout;
|
||||
int ret;
|
||||
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(fd,&fds);
|
||||
timeout.tv_sec = t/1000;
|
||||
timeout.tv_usec = 1000*(t%1000);
|
||||
|
||||
if ((ret = sys_select_intr(fd+1,&fds,NULL,NULL,&timeout)) == -1) {
|
||||
/* errno should be EBADF or EINVAL. */
|
||||
DEBUG(0,("select returned -1, errno = %s (%d)\n",
|
||||
strerror(errno), errno));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ret == 0) /* timeout */
|
||||
return NULL;
|
||||
|
||||
if (FD_ISSET(fd,&fds))
|
||||
return(read_packet(fd,type));
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Receive a UDP/138 packet either via UDP or from the unexpected packet
|
||||
queue. The packet must be a reply packet and have the specified mailslot name
|
||||
|
Loading…
x
Reference in New Issue
Block a user