diff options
| author | Anton <anton@picapica> | 2016-12-29 21:11:08 +0400 |
|---|---|---|
| committer | Anton <anton@picapica> | 2016-12-29 21:11:08 +0400 |
| commit | ebda46444033ac87dccc1fae725a101c8fef38e4 (patch) | |
| tree | 97ae197cd9a121492ec2faeaf1d87db73acc946b | |
| parent | 8c43c0fda7bbc41316021668084f47bedb66c26c (diff) | |
| download | pica-pica-ebda46444033ac87dccc1fae725a101c8fef38e4.tar.gz pica-pica-ebda46444033ac87dccc1fae725a101c8fef38e4.zip | |
implemented PICA_send_directc2cfailed() and PICA_send_directc2c_switch()
| -rw-r--r-- | PICA_client.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/PICA_client.c b/PICA_client.c index 179778a..ef4e2dc 100644 --- a/PICA_client.c +++ b/PICA_client.c @@ -2653,12 +2653,30 @@ int PICA_send_directc2caddrlist(struct PICA_c2c *chn) static int PICA_send_directc2cfailed(struct PICA_c2c *chn) { - -- + struct PICA_proto_msg *mp; + + if ((mp = c2c_writebuf_push(chn, PICA_PROTO_DIRECTC2C_FAILED, PICA_PROTO_DIRECTC2C_FAILED_SIZE))) + { + RAND_pseudo_bytes(mp->tail, 2); + } + else + return PICA_ERRNOMEM; + + return PICA_OK; } static int PICA_send_directc2c_switch(struct PICA_c2c *chn) { - -- + struct PICA_proto_msg *mp; + + if ((mp = c2c_writebuf_push(chn, PICA_PROTO_DIRECTC2C_SWITCH, PICA_PROTO_DIRECTC2C_SWITCH_SIZE))) + { + RAND_pseudo_bytes(mp->tail, 2); + } + else + return PICA_ERRNOMEM; + + return PICA_OK; } int PICA_send_msg(struct PICA_c2c *chn, char *buf, unsigned int len) |
