]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Nasty bug fixed in tcp writer. Commit before I rework the entire thing.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 4 May 2007 12:45:59 +0000 (12:45 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 4 May 2007 12:45:59 +0000 (12:45 +0000)
git-svn-id: file:///svn/unbound/trunk@283 be551aaa-1e26-0410-a405-d3ace91eadb9

util/netevent.c

index 8dca4ed5b7a4645afd9ff230457004952dcfe738..a65ff4ab1f1d527c16d4df21fba43894adbba886 100644 (file)
@@ -436,7 +436,13 @@ comm_point_tcp_handle_write(int fd, struct comm_point* c)
 
        if(c->tcp_byte_count < sizeof(uint16_t)) {
                uint16_t len = htons(ldns_buffer_limit(c->buffer));
-               r = write(fd, &len, sizeof(uint16_t)-c->tcp_byte_count);
+               /*
+               struct iovec iov[2];
+               iov[0].iov_base = (uint8_t*)&len + c->tcp_byte_count;
+               iov[0].iov_len = sizeof(uint16_t) - c->tcp_byte_count;
+               */
+               r = write(fd, (uint8_t*)&len + c->tcp_byte_count, 
+                       sizeof(uint16_t) - c->tcp_byte_count);
                if(r == -1) {
                        if(errno == EINTR || errno == EAGAIN)
                                return 1;