Changeset ccb5165 in mainline for uspace/srv/net/dnsres/transport.c
- Timestamp:
- 2013-04-20T07:28:39Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0041cd6d
- Parents:
- 6d717a4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/dnsres/transport.c
r6d717a4 rccb5165 45 45 46 46 #include <stdio.h> 47 48 #define RECV_BUF_SIZE 4096 49 50 static uint8_t recv_buf[RECV_BUF_SIZE]; 51 47 52 int dns_request(dns_message_t *req, dns_message_t **rresp) 48 53 { … … 53 58 struct sockaddr_in addr; 54 59 struct sockaddr_in laddr; 60 struct sockaddr_in src_addr; 61 socklen_t src_addr_size; 55 62 int fd; 56 63 … … 86 93 goto error; 87 94 95 src_addr_size = sizeof(src_addr); 96 rc = recvfrom(fd, recv_buf, RECV_BUF_SIZE, 0, 97 (struct sockaddr *)&src_addr, &src_addr_size); 98 if (rc < 0) { 99 printf("recvfrom returns error - %d\n", rc); 100 goto error; 101 } 102 103 printf("received %d bytes\n", (int)rc); 104 105 printf("close socket\n"); 88 106 closesocket(fd); 107 printf("free req_data\n"); 89 108 free(req_data); 90 109
Note:
See TracChangeset
for help on using the changeset viewer.