Fix ADC client send queue.
This commit is contained in:
@@ -141,13 +141,13 @@ void ioq_send_remove(struct ioq_send* q, struct adc_message* msg)
|
||||
q->offset = 0;
|
||||
}
|
||||
|
||||
int ioq_send_send(struct ioq_send* q, struct hub_user* user)
|
||||
int ioq_send_send(struct ioq_send* q, struct net_connection* con)
|
||||
{
|
||||
int ret;
|
||||
struct adc_message* msg = list_get_first(q->queue);
|
||||
if (!msg) return 0;
|
||||
uhub_assert(msg->cache && *msg->cache);
|
||||
ret = net_con_send(user->connection, msg->cache + q->offset, msg->length - q->offset);
|
||||
ret = net_con_send(con, msg->cache + q->offset, msg->length - q->offset);
|
||||
|
||||
if (ret > 0)
|
||||
{
|
||||
|
||||
@@ -60,7 +60,7 @@ extern void ioq_send_add(struct ioq_send*, struct adc_message* msg);
|
||||
* Process the send queue, and send as many messages as possible.
|
||||
* @returns -1 on error, 0 if unable to send more, 1 if more can be sent.
|
||||
*/
|
||||
extern int ioq_send_send(struct ioq_send*, struct hub_user*);
|
||||
extern int ioq_send_send(struct ioq_send*, struct net_connection* con);
|
||||
|
||||
/**
|
||||
* @returns 1 if send queue is empty, 0 otherwise.
|
||||
|
||||
@@ -109,7 +109,7 @@ int handle_net_write(struct hub_user* user)
|
||||
int ret = 0;
|
||||
while (ioq_send_get_bytes(user->send_queue))
|
||||
{
|
||||
ret = ioq_send_send(user->send_queue, user);
|
||||
ret = ioq_send_send(user->send_queue, user->connection);
|
||||
if (ret <= 0)
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user