THROW1(system_error,0,"setsockopt failed, cannot condition the socket: %s",
sock_errstr);
THROW1(system_error,0,"setsockopt failed, cannot condition the socket: %s",
sock_errstr);
if (setsockopt(sd, SOL_SOCKET, SO_RCVBUF, (char *)&size, sizeof(size))
|| setsockopt(sd, SOL_SOCKET, SO_SNDBUF, (char *)&size, sizeof(size)))
WARN1("setsockopt failed, cannot set buffer size: %s", sock_errstr);
if (setsockopt(sd, SOL_SOCKET, SO_RCVBUF, (char *)&size, sizeof(size))
|| setsockopt(sd, SOL_SOCKET, SO_SNDBUF, (char *)&size, sizeof(size)))
WARN1("setsockopt failed, cannot set buffer size: %s", sock_errstr);
DEBUG5("read(%d, %p, %ld) got %d so far (%s)",
sock->sd, data+got, bufsize, got,
DEBUG5("read(%d, %p, %ld) got %d so far (%s)",
sock->sd, data+got, bufsize, got,
sock->sd, data+got, (int)size,
sock_errstr);
}
sock->sd, data+got, (int)size,
sock_errstr);
}
- DEBUG2("Got %d more bytes (%s)",status,hexa_str(data+got,status));
+ DEBUG2("Got %d more bytes (%s)",status,hexa_str((unsigned char*)data+got,status));
- THROW0(system_error,0,"Socket closed by remote side");
+ THROW1(system_error,0,"Socket closed by remote side (got %d bytes before this)",
+ got);
hexa_print("chunk to send ",
(unsigned char *) data->out_buf.data,data->out_buf.size);
if ((data->out_buf.size - data->out_buf.pos) != 0) {
hexa_print("chunk to send ",
(unsigned char *) data->out_buf.data,data->out_buf.size);
if ((data->out_buf.size - data->out_buf.pos) != 0) {
memcpy(data->out_buf.data + data->out_buf.size, chunk + chunk_pos, thissize);
data->out_buf.size += thissize;
chunk_pos += thissize;
DEBUG4("New pos = %d; Still to send = %ld of %ld; ctn sofar=(%s)",
memcpy(data->out_buf.data + data->out_buf.size, chunk + chunk_pos, thissize);
data->out_buf.size += thissize;
chunk_pos += thissize;
DEBUG4("New pos = %d; Still to send = %ld of %ld; ctn sofar=(%s)",
- data->out_buf.size,size-chunk_pos,size,hexa_str((char*)chunk,chunk_pos));
+ data->out_buf.size,size-chunk_pos,size,hexa_str((unsigned char*)chunk,chunk_pos));
data->in_buf.pos += thissize;
chunk_pos += thissize;
DEBUG4("New pos = %d; Still to receive = %ld of %ld. Ctn so far=(%s)",
data->in_buf.pos += thissize;
chunk_pos += thissize;
DEBUG4("New pos = %d; Still to receive = %ld of %ld. Ctn so far=(%s)",
- data->in_buf.pos,size - chunk_pos,size,hexa_str(chunk,chunk_pos));
+ data->in_buf.pos,size - chunk_pos,size,hexa_str((unsigned char*)chunk,chunk_pos));