Work in progress ...

FossilOrigin-Name: a76e8760f309d36aad22507f961ac5a03f46df9ee585c2f8601ee0a5a088738e
This commit is contained in:
7u83@mail.ru
2015-02-01 15:55:45 +00:00
parent 84e6d01348
commit c851831463
23 changed files with 236 additions and 68 deletions

View File

@ -22,10 +22,14 @@
#include "conn.h"
#include "cwmsg.h"
#include <stdio.h> //Tube
void cwmsg_addelem_mtu_discovery_padding(struct cwmsg * msg, struct conn* conn)
{
int len = conn->mtu - (msg->msgelems-msg->buffer+msg->pos)-4;
printf("MTU discovery len %d %d and pos %d:\n",conn->mtu,len,msg->pos);
if (len < 0 )
return;
@ -33,5 +37,7 @@ void cwmsg_addelem_mtu_discovery_padding(struct cwmsg * msg, struct conn* conn)
*((uint32_t*)(msg->msgelems+msg->pos))=htonl(val);
memset(msg->msgelems+4+msg->pos,0xff,len);
msg->pos+=4+len;
printf("Nenpos = %d\n",msg->pos);
}