comparison src/director/director-connection.c @ 14431:084064444f89

director: Don't try to send the new SYNC parameter to old director versions. This should allow adding new directors to an old director ring without anything breaking. Once all directors have upgraded they start using the new features.
author Timo Sirainen <tss@iki.fi>
date Mon, 09 Apr 2012 07:52:25 +0300
parents b43ae3805f5f
children 366b9e5fc85c
comparison
equal deleted inserted replaced
14430:f267a2b3f424 14431:084064444f89
80 80
81 struct director_connection { 81 struct director_connection {
82 struct director *dir; 82 struct director *dir;
83 char *name; 83 char *name;
84 time_t created; 84 time_t created;
85 unsigned int minor_version;
85 86
86 /* for incoming connections the director host isn't known until 87 /* for incoming connections the director host isn't known until
87 ME-line is received */ 88 ME-line is received */
88 struct director_host *host; 89 struct director_host *host;
89 90
888 i_error("director(%s): Incompatible protocol version: " 889 i_error("director(%s): Incompatible protocol version: "
889 "%u vs %u", conn->name, atoi(args[1]), 890 "%u vs %u", conn->name, atoi(args[1]),
890 DIRECTOR_VERSION_MAJOR); 891 DIRECTOR_VERSION_MAJOR);
891 return -1; 892 return -1;
892 } 893 }
894 conn->minor_version = atoi(args[2]);
893 conn->version_received = TRUE; 895 conn->version_received = TRUE;
894 return 1; 896 return 1;
895 } 897 }
896 if (!conn->version_received) { 898 if (!conn->version_received) {
897 director_cmd_error(conn, "Incompatible protocol"); 899 director_cmd_error(conn, "Incompatible protocol");
1526 bool director_connection_is_incoming(struct director_connection *conn) 1528 bool director_connection_is_incoming(struct director_connection *conn)
1527 { 1529 {
1528 return conn->in; 1530 return conn->in;
1529 } 1531 }
1530 1532
1533 unsigned int
1534 director_connection_get_minor_version(struct director_connection *conn)
1535 {
1536 return conn->minor_version;
1537 }
1538
1531 void director_connection_cork(struct director_connection *conn) 1539 void director_connection_cork(struct director_connection *conn)
1532 { 1540 {
1533 o_stream_cork(conn->output); 1541 o_stream_cork(conn->output);
1534 } 1542 }
1535 1543