/*
* $Log$
+ * Revision 1.3 2008/02/14 02:46:44 james
+ * *** empty log message ***
+ *
* Revision 1.2 2008/02/14 00:57:58 james
* *** empty log message ***
*
return ret;
}
+
void
socket_consume_msg (Socket * s)
{
if (!s->msg)
return;
- ipc_consume_message_in_slide(s->read_buf);
+ ipc_consume_message_in_slide (s->read_buf);
s->msg = ipc_check_for_message_in_slide (s->read_buf);
}
{
char buf[1024];
int n;
- int error=0;
+ int error = 0;
if ((!SLIDE_EMPTY (s->write_buf)) && FD_ISSET (s->fd, wfds))
n = wrap_write (s->fd, SLIDE_RPTR (s->write_buf), n);
if (n > 0)
slide_consume (s->write_buf, n);
- if (n<0) error=-1;
+ if (n < 0)
+ error = -1;
}
if (!SLIDE_FULL (s->read_buf) && FD_ISSET (s->fd, rfds))
n = wrap_read (s->fd, SLIDE_WPTR (s->read_buf), n);
if (n > 0)
slide_added (s->read_buf, n);
- if (n<0) error=-1;
+ if (n < 0)
+ error = -1;
}
s->msg = ipc_check_for_message_in_slide (s->read_buf);
(SLIDE_BYTES (s->write_buf) >
MAX_TXN) ? MAX_TXN : SLIDE_BYTES (s->write_buf);
n = wrap_write (s->fd, SLIDE_RPTR (s->write_buf), n);
- {
- uint8_t *c=SLIDE_RPTR(s->write_buf);
+ {
+ uint8_t *c = SLIDE_RPTR (s->write_buf);
}
if (n > 0)
slide_consume (s->write_buf, n);
-
- if (n<0) return -1;
+
+ if (n < 0)
+ return -1;
return len;
}