Commit c4e9f0a1 authored by Pekka Pessi's avatar Pekka Pessi

tport.c: fixed some 64-bit issues.

darcs-hash:20060925192135-65a35-7620f560dd3957017f11bc5c8fa01098def8fcca.gz
parent 5a88e682
......@@ -340,7 +340,7 @@ static int
struct sigcomp_compartment *cc),
tport_send_error(tport_t *, msg_t *, tp_name_t const *),
tport_queue(tport_t *self, msg_t *msg),
tport_queue_rest(tport_t *self, msg_t *msg, msg_iovec_t iov[], int iovused),
tport_queue_rest(tport_t *self, msg_t *msg, msg_iovec_t iov[], ssize_t iovused),
tport_pending_error(tport_t *self, su_sockaddr_t const *dst, int error),
tport_pending_errmsg(tport_t *self, msg_t *msg, int error);
......@@ -2826,7 +2826,8 @@ tport_delivered_with_comp(tport_t *tp, msg_t const *msg,
*/
ssize_t tport_recv_iovec(tport_t const *self,
msg_t **in_out_msg,
msg_iovec_t iovec[msg_n_fragments], int N,
msg_iovec_t iovec[msg_n_fragments],
size_t N,
int exact)
{
msg_t *msg = *in_out_msg;
......@@ -2843,7 +2844,7 @@ ssize_t tport_recv_iovec(tport_t const *self,
*/
if (!msg) {
if (!(*in_out_msg = msg = tport_msg_alloc(self, N))) {
SU_DEBUG_7(("%s(%p): cannot allocate msg for %u bytes "
SU_DEBUG_7(("%s(%p): cannot allocate msg for "MOD_ZU" bytes "
"from (%s/%s:%s)\n",
__func__, self, N,
self->tp_protoname, self->tp_host, self->tp_port));
......@@ -2862,7 +2863,7 @@ ssize_t tport_recv_iovec(tport_t const *self,
}
if (veclen < 0) {
int err = su_errno();
SU_DEBUG_7(("%s(%p): cannot get msg %p buffer for %u bytes "
SU_DEBUG_7(("%s(%p): cannot get msg %p buffer for "MOD_ZU" bytes "
"from (%s/%s:%s): %s\n",
__func__, self, msg, N,
self->tp_protoname, self->tp_host, self->tp_port,
......@@ -2873,12 +2874,13 @@ ssize_t tport_recv_iovec(tport_t const *self,
assert(veclen <= msg_n_fragments);
SU_DEBUG_7(("%s(%p) msg %p from (%s/%s:%s) has %u bytes, veclen = %d\n",
SU_DEBUG_7(("%s(%p) msg %p from (%s/%s:%s) has "MOD_ZU" bytes, "
"veclen = "MOD_ZD"\n",
__func__, self,
msg, self->tp_protoname, self->tp_host, self->tp_port,
N, veclen));
for (N = 0; veclen > 1 && N < veclen; N++) {
SU_DEBUG_7(("\tiovec[%u] = %lu bytes\n", N, (LU)iovec[N].mv_len));
SU_DEBUG_7(("\tiovec["MOD_ZU"] = %lu bytes\n", N, (LU)iovec[N].mv_len));
}
return veclen;
......@@ -3157,7 +3159,7 @@ int tport_send_msg(tport_t *self, msg_t *msg,
self->tp_time = su_time_ms(now = su_now());
n = tport_vsend(self, msg, tpn, iov, iovused, cc);
SU_DEBUG_9(("tport_vsend returned %d\n", n));
SU_DEBUG_9(("tport_vsend returned "MOD_ZD"\n", n));
if (n < 0)
return n;
......@@ -3246,7 +3248,7 @@ int tport_vsend(tport_t *self,
if (tpn == NULL || tport_is_connection_oriented(self))
tpn = self->tp_name;
SU_DEBUG_7(("tport_vsend(%p): %d bytes of %u to %s/%s:%s%s\n",
SU_DEBUG_7(("tport_vsend(%p): "MOD_ZU" bytes of "MOD_ZU" to %s/%s:%s%s\n",
self, n, m, tpn->tpn_proto, tpn->tpn_host,
tpn->tpn_port,
(ai->ai_flags & TP_AI_COMPRESSED) ? ";comp=sigcomp" : ""));
......
......@@ -396,7 +396,7 @@ void tport_hup_event(tport_t *self);
ssize_t tport_recv_iovec(tport_t const *self,
msg_t **mmsg,
msg_iovec_t iovec[msg_n_fragments], int N,
msg_iovec_t iovec[msg_n_fragments], size_t N,
int exact);
msg_t *tport_msg_alloc(tport_t const *self, unsigned size);
......
......@@ -337,14 +337,15 @@ static int tport_recv_sigcomp_r(tport_t *self,
int N)
{
msg_t *msg;
unsigned n, m, i, eos, complete;
int veclen;
size_t n, m, i;
int eos, complete;
ssize_t veclen;
msg_iovec_t iovec[msg_n_fragments] = {{ 0 }};
su_sockaddr_t su[1];
socklen_t su_size = sizeof(su);
struct sigcomp_buffer *input, *output;
void *data;
unsigned dlen;
size_t dlen;
SU_DEBUG_7(("%s(%p)\n", __func__, self));
......
......@@ -527,9 +527,10 @@ int thrp_udvm_decompress(threadpool_t *thrp, thrp_udp_deliver_t *tpd)
msg_iovec_t iovec[msg_n_fragments] = {{ 0 }};
su_addrinfo_t *ai;
tport_t *tp = thrp->thrp_tport->pri_primary;
unsigned n, m, i, eos, dlen;
size_t n, m, i, dlen;
int eos;
void *data;
int veclen;
ssize_t veclen;
output = sigcomp_udvm_output_buffer(udvm, -1);
......
......@@ -213,7 +213,7 @@ static
int tport_recv_sctp(tport_t *self)
{
msg_t *msg;
int N, veclen;
ssize_t N, veclen;
msg_iovec_t iovec[2] = {{ 0 }};
char sctp_buf[TP_SCTP_MSG_MAX];
......
......@@ -71,7 +71,7 @@ static void tport_tls_deinit_secondary(tport_t *self);
static void tport_tls_shutdown(tport_t *self, int how);
static int tport_tls_set_events(tport_t const *self);
static int tport_tls_events(tport_t *self, int events);
static ssize_t tport_tls_recv(tport_t *self);
static int tport_tls_recv(tport_t *self);
static ssize_t tport_tls_send(tport_t const *self, msg_t *msg,
msg_iovec_t iov[], size_t iovused);
......@@ -352,13 +352,13 @@ int tport_tls_recv(tport_t *self)
{
tport_tls_t *tlstp = (tport_tls_t *)self;
msg_t *msg;
int n, N, veclen, i, m;
ssize_t n, N, veclen, i, m;
msg_iovec_t iovec[msg_n_fragments] = {{ 0 }};
char *tls_buf;
N = tls_read(tlstp->tlstp_context);
SU_DEBUG_7(("%s(%p): tls_read() returned %d\n", __func__, self, N));
SU_DEBUG_7(("%s(%p): tls_read() returned "MOD_ZD"\n", __func__, self, N));
if (N == 0) /* End-of-stream */
return 0;
......@@ -461,7 +461,7 @@ ssize_t tport_tls_send(tport_t const *self,
n = tls_write(tlstp->tlstp_context, buf, m);
#endif
SU_DEBUG_9(("tport_tls_writevec: vec %p %p %lu (%d)\n",
SU_DEBUG_9(("tport_tls_writevec: vec %p %p %lu ("MOD_ZD")\n",
tlstp->tlstp_context, iov[i].siv_base, (LU)iov[i].siv_len, n));
if (n < 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment