mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
Allow specifying a max outgoing segment size per TCP socket
This commit is contained in:
parent
ce914b3173
commit
0dbed5b919
@ -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