107 |
ptr = arg; |
ptr = arg; |
108 |
/* fail on too much data */ |
/* fail on too much data */ |
109 |
if (len > pcb->snd_buf) { |
if (len > pcb->snd_buf) { |
110 |
DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_enqueue: too much data (len=%d > snd_buf=%d)\n", len, pcb->snd_buf)); |
DEBUGF(TCP_OUTPUT_DEBUG | 3, ("tcp_enqueue: too much data (len=%d > snd_buf=%d)\n", len, pcb->snd_buf)); |
111 |
return ERR_MEM; |
return ERR_MEM; |
112 |
} |
} |
113 |
|
|
173 |
} |
} |
174 |
else if (copy) { |
else if (copy) { |
175 |
if ((seg->p = pbuf_alloc(PBUF_TRANSPORT, seglen, PBUF_RAM)) == NULL) { |
if ((seg->p = pbuf_alloc(PBUF_TRANSPORT, seglen, PBUF_RAM)) == NULL) { |
176 |
DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_enqueue: could not allocate memory for pbuf copy size %u\n", seglen)); |
DEBUGF(TCP_OUTPUT_DEBUG | 2, ("tcp_enqueue : could not allocate memory for pbuf copy size %u\n", seglen)); |
177 |
goto memerr; |
goto memerr; |
178 |
} |
} |
179 |
++queuelen; |
++queuelen; |
222 |
} |
} |
223 |
|
|
224 |
seg->len = seglen; |
seg->len = seglen; |
225 |
/* if ((flags & TCP_SYN) || (flags & TCP_FIN)) { |
#if 0 /* Was commented out. TODO: can someone say why this is here? */ |
226 |
++seg->len; |
if ((flags & TCP_SYN) || (flags & TCP_FIN)) { |
227 |
}*/ |
++seg->len; |
228 |
|
} |
229 |
|
#endif |
230 |
/* Build TCP header. */ |
/* Build TCP header. */ |
231 |
if (pbuf_header(seg->p, TCP_HLEN)) { |
if (pbuf_header(seg->p, TCP_HLEN)) { |
232 |
|
|
294 |
useg->len += queue->len; |
useg->len += queue->len; |
295 |
useg->next = queue->next; |
useg->next = queue->next; |
296 |
|
|
297 |
DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_enqueue: chaining, new len %u\n", useg->len)); |
DEBUGF(TCP_OUTPUT_DEBUG | DBG_TRACE | DBG_STATE, ("tcp_enqueue: chaining, new len %u\n", useg->len)); |
298 |
if (seg == queue) { |
if (seg == queue) { |
299 |
seg = NULL; |
seg = NULL; |
300 |
} |
} |