summaryrefslogtreecommitdiff
path: root/pjlib/src/pj/ioqueue_common_abs.c
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-01-20 21:03:36 +0000
committerBenny Prijono <bennylp@teluu.com>2006-01-20 21:03:36 +0000
commit7638eeee106fe58a1225f642e733629f29418818 (patch)
tree154947de290f76741923bbf8541dccd9c6386d93 /pjlib/src/pj/ioqueue_common_abs.c
parent47e7de1c94be7f826080b3711451eafee894791f (diff)
Completed testing for WinCE port
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@126 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pj/ioqueue_common_abs.c')
-rw-r--r--pjlib/src/pj/ioqueue_common_abs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pjlib/src/pj/ioqueue_common_abs.c b/pjlib/src/pj/ioqueue_common_abs.c
index 9b59657e..168b4f1e 100644
--- a/pjlib/src/pj/ioqueue_common_abs.c
+++ b/pjlib/src/pj/ioqueue_common_abs.c
@@ -247,7 +247,6 @@ void ioqueue_dispatch_write_event(pj_ioqueue_t *ioqueue, pj_ioqueue_key_t *h)
*/
if (h->fd_type == PJ_SOCK_DGRAM) {
pj_list_erase(write_op);
- write_op->op = 0;
if (pj_list_empty(&h->write_list))
ioqueue_remove_from_set(ioqueue, h->fd, WRITEABLE_EVENT);
@@ -261,9 +260,11 @@ void ioqueue_dispatch_write_event(pj_ioqueue_t *ioqueue, pj_ioqueue_key_t *h)
*/
sent = write_op->size - write_op->written;
if (write_op->op == PJ_IOQUEUE_OP_SEND) {
+ write_op->op = 0;
send_rc = pj_sock_send(h->fd, write_op->buf+write_op->written,
&sent, write_op->flags);
} else if (write_op->op == PJ_IOQUEUE_OP_SEND_TO) {
+ write_op->op = 0;
send_rc = pj_sock_sendto(h->fd,
write_op->buf+write_op->written,
&sent, write_op->flags,
@@ -271,6 +272,7 @@ void ioqueue_dispatch_write_event(pj_ioqueue_t *ioqueue, pj_ioqueue_key_t *h)
write_op->rmt_addrlen);
} else {
pj_assert(!"Invalid operation type!");
+ write_op->op = 0;
send_rc = PJ_EBUG;
}
@@ -370,7 +372,6 @@ void ioqueue_dispatch_read_event( pj_ioqueue_t *ioqueue, pj_ioqueue_key_t *h )
/* Get one pending read operation from the list. */
read_op = h->read_list.next;
pj_list_erase(read_op);
- read_op->op = 0;
/* Clear fdset if there is no pending read. */
if (pj_list_empty(&h->read_list))
@@ -382,13 +383,16 @@ void ioqueue_dispatch_read_event( pj_ioqueue_t *ioqueue, pj_ioqueue_key_t *h )
bytes_read = read_op->size;
if ((read_op->op == PJ_IOQUEUE_OP_RECV_FROM)) {
+ read_op->op = 0;
rc = pj_sock_recvfrom(h->fd, read_op->buf, &bytes_read, 0,
read_op->rmt_addr,
read_op->rmt_addrlen);
} else if ((read_op->op == PJ_IOQUEUE_OP_RECV)) {
+ read_op->op = 0;
rc = pj_sock_recv(h->fd, read_op->buf, &bytes_read, 0);
} else {
pj_assert(read_op->op == PJ_IOQUEUE_OP_READ);
+ read_op->op = 0;
/*
* User has specified pj_ioqueue_read().
* On Win32, we should do ReadFile(). But because we got