~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to erts/epmd/src/epmd_srv.c

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2010-03-09 17:34:57 UTC
  • mfrom: (10.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100309173457-4yd6hlcb2osfhx31
Tags: 1:13.b.4-dfsg-3
Manpages in section 1 are needed even if only arch-dependent packages are
built. So, re-enabled them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- c-indent-level: 2; c-continued-statement-offset: 2 -*- */ 
2
2
/*
3
3
 * %CopyrightBegin%
4
 
 * 
5
 
 * Copyright Ericsson AB 1998-2009. All Rights Reserved.
6
 
 * 
 
4
 *
 
5
 * Copyright Ericsson AB 1998-2010. All Rights Reserved.
 
6
 *
7
7
 * The contents of this file are subject to the Erlang Public License,
8
8
 * Version 1.1, (the "License"); you may not use this file except in
9
9
 * compliance with the License. You should have received a copy of the
10
10
 * Erlang Public License along with this software. If not, it can be
11
11
 * retrieved online at http://www.erlang.org/.
12
 
 * 
 
12
 *
13
13
 * Software distributed under the License is distributed on an "AS IS"
14
14
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15
15
 * the License for the specific language governing rights and limitations
16
16
 * under the License.
17
 
 * 
 
17
 *
18
18
 * %CopyrightEnd%
19
19
 */
20
20
 
99
99
 
100
100
static void node_init(EpmdVars*);
101
101
static Node *node_reg(EpmdVars*,char*,int,int);
102
 
static Node *node_reg2(EpmdVars*,char*, int, int, unsigned char, unsigned char, int, int, char*);
 
102
static Node *node_reg2(EpmdVars*,char*, int, int, unsigned char, unsigned char, int, int, int, char*);
103
103
static int node_unreg(EpmdVars*,char*);
104
104
static int node_unreg_sock(EpmdVars*,int);
105
105
 
558
558
            }
559
559
        name = &buf[11];
560
560
        name[namelen]='\000';
561
 
        extra = &buf[11+namelen+1];
 
561
        extra = &buf[11+namelen+2];
562
562
        extra[extralen]='\000';
563
563
        wbuf[0] = EPMD_ALIVE2_RESP;
564
564
        if ((node = node_reg2(g, name, fd, eport, nodetype, protocol,
565
 
                              highvsn, lowvsn, extra)) == NULL) {
 
565
                              highvsn, lowvsn, extralen, extra)) == NULL) {
566
566
            wbuf[1] = 1; /* error */
567
567
            put_int16(99, wbuf+2);
568
568
        } else {
622
622
                offset = 12;
623
623
                strcpy(wbuf + offset,node->symname);
624
624
                offset += strlen(node->symname);
625
 
                put_int16(strlen(node->extra),wbuf + offset);
 
625
                put_int16(node->extralen,wbuf + offset);
626
626
                offset += 2;
627
 
                strcpy(wbuf + offset,node->extra);
628
 
                offset += (strlen(node->extra)-1);
 
627
                memcpy(wbuf + offset,node->extra,node->extralen);
 
628
                offset += node->extralen;
629
629
                if (reply(g, fd, wbuf, offset) != offset)
630
630
                  {
631
631
                    dbg_tty_printf(g,1,"** failed to send PORT2_RESP (ok) for \"%s\"",name);
994
994
 
995
995
static Node *node_reg(EpmdVars *g,char *name,int fd, int port)
996
996
{
997
 
    return node_reg2(g, name, fd, port, 0, 0, 0, 0, NULL);
 
997
    return node_reg2(g, name, fd, port, 0, 0, 0, 0, 0, NULL);
998
998
}
999
999
 
1000
1000
static Node *node_reg2(EpmdVars *g,
1005
1005
                       unsigned char protocol,
1006
1006
                       int highvsn,
1007
1007
                       int lowvsn,
 
1008
                       int extralen,
1008
1009
                       char* extra)
1009
1010
{
1010
1011
  Node *prev;                   /* Point to previous node or NULL */
1103
1104
  node->protocol = protocol;
1104
1105
  node->highvsn  = highvsn;
1105
1106
  node->lowvsn   = lowvsn;
1106
 
  strcpy(node->extra,extra);
 
1107
  node->extralen = extralen;
 
1108
  memcpy(node->extra,extra,extralen);
1107
1109
  strcpy(node->symname,name);
1108
1110
  FD_SET(fd,&g->orig_read_mask);
1109
1111