src/lib/bsock.c
BSOCK *init_bsock(JCR *jcr, int sockfd, const char *who,
                   const char *host, int port, struct sockaddr *client_addr)
{
   Dmsg4(100, "socket=%d who=%s host=%s port=%d\n", sockfd, who, host, port);
   BSOCK *bsock = New(BSOCK(sockfd));
   bsock->m_master = bsock; /* don't use set_master() here */
   bsock->set_who(bstrdup(who));
   bsock->set_host(bstrdup(host));
   bsock->set_port(port);
   bmemzero(&bsock->peer_addr, sizeof(bsock->peer_addr));
   memcpy(&bsock->client_addr, client_addr, sizeof(bsock->client_addr));
   bsock->set_jcr(jcr);
   return bsock;
}
/* Initialize internal socket structure.
 *  This probably should be done in bsock.c
 */
Initialize internal socket structure.
This probably should be done in bsock.c
Initialize internal socket structure . This probably should be done in bsock . c
BSOCK *init_bsock(JCR *jcr, int sockfd, const char *who,
                   const char *host, int port, struct sockaddr *client_addr)
{
   Dmsg4(100, "socket=%d who=%s host=%s port=%d\n", sockfd, who, host, port);
   BSOCK *bsock = New(BSOCK(sockfd));
   bsock->m_master = bsock; 
   bsock->set_who(bstrdup(who));
   bsock->set_host(bstrdup(host));
   bsock->set_port(port);
   bmemzero(&bsock->peer_addr, sizeof(bsock->peer_addr));
   memcpy(&bsock->client_addr, client_addr, sizeof(bsock->client_addr));
   bsock->set_jcr(jcr);
   return bsock;
}
BSOCK * init_bsock ( JCR * jcr , int sockfd , const char * who , const char * host , int port , struct sockaddr * client_addr ) { Dmsg4 ( 100 , " \n " , sockfd , who , host , port ) ; BSOCK * bsock = New ( BSOCK ( sockfd ) ) ; bsock -> m_master = bsock ; bsock -> set_who ( bstrdup ( who ) ) ; bsock -> set_host ( bstrdup ( host ) ) ; bsock -> set_port ( port ) ; bmemzero ( & bsock -> peer_addr , sizeof ( bsock -> peer_addr ) ) ; memcpy ( & bsock -> client_addr , client_addr , sizeof ( bsock -> client_addr ) ) ; bsock -> set_jcr ( jcr ) ; return bsock ; }
Initialize internal socket structure.
Initialize internal socket structure .
/* don't use set_master() here */