mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
Merge pull request #899 from g-oikonomou/tcp-sock-max-seg
Allow specifying a max outgoing segment size per TCP socket
This commit is contained in:
commit
47ecc8b5a6
@ -56,10 +56,10 @@ call_event(struct tcp_socket *s, tcp_socket_event_t event)
|
||||
static void
|
||||
senddata(struct tcp_socket *s)
|
||||
{
|
||||
int len;
|
||||
int len = MIN(s->output_data_max_seg, uip_mss());
|
||||
|
||||
if(s->output_data_len > 0) {
|
||||
len = MIN(s->output_data_len, uip_mss());
|
||||
len = MIN(s->output_data_len, len);
|
||||
s->output_data_send_nxt = len;
|
||||
uip_send(s->output_data_ptr, len);
|
||||
}
|
||||
@ -255,6 +255,7 @@ tcp_socket_register(struct tcp_socket *s, void *ptr,
|
||||
s->input_data_maxlen = input_databuf_len;
|
||||
s->output_data_ptr = output_databuf;
|
||||
s->output_data_maxlen = output_databuf_len;
|
||||
s->output_data_max_seg = uip_mss();
|
||||
s->input_callback = input_callback;
|
||||
s->event_callback = event_callback;
|
||||
list_add(socketlist, s);
|
||||
|
@ -95,6 +95,7 @@ struct tcp_socket {
|
||||
uint16_t output_data_maxlen;
|
||||
uint16_t output_data_len;
|
||||
uint16_t output_data_send_nxt;
|
||||
uint16_t output_data_max_seg;
|
||||
|
||||
uint8_t flags;
|
||||
uint16_t listen_port;
|
||||
|
Loading…
Reference in New Issue
Block a user