Permalink
Browse files

More messages for debugging

  • Loading branch information...
1 parent 0eebc39 commit b3118947d88fecdeeb943f466c4c34217c5535af @vi committed Feb 26, 2013
Showing with 13 additions and 0 deletions.
  1. +10 −0 packet.c
  2. +3 −0 storage.c
View
@@ -189,6 +189,7 @@ static ssize_t reliable_write(int fd, void *buf, size_t count)
size_t count_left = count;
int ret;
+ //fprintf(stderr, "reliable_write fd=%d buf=%p count=%d\n", fd, buf, count);
while (count_left > 0) {
ret = send(fd, buf, count_left, 0);
if (ret > 0) {
@@ -199,6 +200,10 @@ static ssize_t reliable_write(int fd, void *buf, size_t count)
} else if (ret < 0 && (errno == EINTR || errno == EAGAIN)) {
/* immediate retry */
} else {
+ fprintf(stderr, "fd=%d ret=%d errno=%d\n", fd, ret, errno);
+ #ifdef WIN32
+ fprintf(stderr, "WLE=%d\n", WSAGetLastError());
+ #endif
perror("reliable_write unable to recover");
return ret;
}
@@ -212,6 +217,7 @@ static ssize_t reliable_read(int fd, void *buf, size_t count)
size_t count_left = count;
int ret;
+ //fprintf(stderr, "reliable_read fd=%d buf=%p count=%d\n", fd, buf, count);
while (count_left > 0) {
ret = recv(fd, buf, count_left, 0);
if (ret > 0) {
@@ -222,6 +228,10 @@ static ssize_t reliable_read(int fd, void *buf, size_t count)
} else if (ret < 0 && (errno == EINTR || errno == EAGAIN)) {
/* immediate retry */
} else {
+ fprintf(stderr, "fd=%d ret=%d errno=%d\n", fd, ret, errno);
+ #ifdef WIN32
+ fprintf(stderr, "WLE=%d\n", WSAGetLastError());
+ #endif
perror("reliable_read unable to recover");
return ret;
}
View
@@ -643,6 +643,9 @@ int main(int argc, const char **argv)
perror("accept");
return;
}
+
+ fprintf(stderr, "W=%d ss=%d client=%d\n", WSAGetLastError(), ss, client);
+
struct lo_packet *rq;
umask(0);

0 comments on commit b311894

Please sign in to comment.