mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-30 12:32:37 +00:00
Converted the length argument of netconn_write (and therefore also api_msg_msg.msg.w.len) from u16_t into int to be able to send a bigger buffer than 64K with one time (mainly used from lwip_send).
This commit is contained in:
parent
67795ad26e
commit
f49fc35f55
@ -19,6 +19,12 @@ HISTORY
|
|||||||
|
|
||||||
++ New features:
|
++ New features:
|
||||||
|
|
||||||
|
2007-06-21 Simon Goldschmidt
|
||||||
|
* api_lib.c, api_msg.c, api.h, api_msg.h: Converted the length argument of
|
||||||
|
netconn_write (and therefore also api_msg_msg.msg.w.len) from u16_t into
|
||||||
|
int to be able to send a bigger buffer than 64K with one time (mainly
|
||||||
|
used from lwip_send).
|
||||||
|
|
||||||
2007-06-21 Simon Goldschmidt
|
2007-06-21 Simon Goldschmidt
|
||||||
* tcp.h, api_msg.c: Moved the nagle algorithm from netconn_write/do_write
|
* tcp.h, api_msg.c: Moved the nagle algorithm from netconn_write/do_write
|
||||||
into a define (tcp_output_nagle) in tcp.h to provide it to raw api users, too.
|
into a define (tcp_output_nagle) in tcp.h to provide it to raw api users, too.
|
||||||
|
@ -775,7 +775,7 @@ netconn_send(struct netconn *conn, struct netbuf *buf)
|
|||||||
* @return ERR_OK if data was sent, any other err_t on error
|
* @return ERR_OK if data was sent, any other err_t on error
|
||||||
*/
|
*/
|
||||||
err_t
|
err_t
|
||||||
netconn_write(struct netconn *conn, const void *dataptr, u16_t size, u8_t copy)
|
netconn_write(struct netconn *conn, const void *dataptr, int size, u8_t copy)
|
||||||
{
|
{
|
||||||
struct api_msg msg;
|
struct api_msg msg;
|
||||||
|
|
||||||
|
@ -732,7 +732,14 @@ do_writemore(struct netconn *conn)
|
|||||||
LWIP_ASSERT("conn->state == NETCONN_WRITE", (conn->state == NETCONN_WRITE));
|
LWIP_ASSERT("conn->state == NETCONN_WRITE", (conn->state == NETCONN_WRITE));
|
||||||
|
|
||||||
dataptr = (u8_t*)conn->write_msg->msg.w.dataptr + conn->write_offset;
|
dataptr = (u8_t*)conn->write_msg->msg.w.dataptr + conn->write_offset;
|
||||||
len = conn->write_msg->msg.w.len - conn->write_offset;
|
if ((conn->write_msg->msg.w.len - conn->write_offset > 0xffff)) { /* max_u16_t */
|
||||||
|
len = 0xffff;
|
||||||
|
#if LWIP_TCPIP_CORE_LOCKING
|
||||||
|
conn->write_delayed = 1;
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
len = conn->write_msg->msg.w.len - conn->write_offset;
|
||||||
|
}
|
||||||
available = tcp_sndbuf(conn->pcb.tcp);
|
available = tcp_sndbuf(conn->pcb.tcp);
|
||||||
if (available < len) {
|
if (available < len) {
|
||||||
/* don't try to write more than sendbuf */
|
/* don't try to write more than sendbuf */
|
||||||
|
@ -123,7 +123,7 @@ struct netconn {
|
|||||||
struct api_msg_msg *write_msg;
|
struct api_msg_msg *write_msg;
|
||||||
/** TCP: when data passed to netconn_write doesn't fit into the send buffer,
|
/** TCP: when data passed to netconn_write doesn't fit into the send buffer,
|
||||||
this temporarily stores how much is already sent. */
|
this temporarily stores how much is already sent. */
|
||||||
u16_t write_offset;
|
int write_offset;
|
||||||
#if LWIP_TCPIP_CORE_LOCKING
|
#if LWIP_TCPIP_CORE_LOCKING
|
||||||
/** TCP: when data passed to netconn_write doesn't fit into the send buffer,
|
/** TCP: when data passed to netconn_write doesn't fit into the send buffer,
|
||||||
this temporarily stores whether to wake up the original application task
|
this temporarily stores whether to wake up the original application task
|
||||||
@ -187,7 +187,7 @@ err_t netconn_sendto (struct netconn *conn,
|
|||||||
err_t netconn_send (struct netconn *conn,
|
err_t netconn_send (struct netconn *conn,
|
||||||
struct netbuf *buf);
|
struct netbuf *buf);
|
||||||
err_t netconn_write (struct netconn *conn,
|
err_t netconn_write (struct netconn *conn,
|
||||||
const void *dataptr, u16_t size,
|
const void *dataptr, int size,
|
||||||
u8_t copy);
|
u8_t copy);
|
||||||
err_t netconn_close (struct netconn *conn);
|
err_t netconn_close (struct netconn *conn);
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ struct api_msg_msg {
|
|||||||
} bc; /* do_bind, do_connect */
|
} bc; /* do_bind, do_connect */
|
||||||
struct {
|
struct {
|
||||||
const void *dataptr;
|
const void *dataptr;
|
||||||
u16_t len;
|
int len;
|
||||||
u8_t copy;
|
u8_t copy;
|
||||||
} w; /* do_write */
|
} w; /* do_write */
|
||||||
struct {
|
struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user