Changes in uspace/srv/net/dnsrsrv/transport.c [06fe3b6:5d1cb8a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/dnsrsrv/transport.c
r06fe3b6 r5d1cb8a 54 54 #define REQ_TIMEOUT (5*1000*1000) 55 55 56 /** Maximum number of retries */57 #define REQ_RETRY_MAX 358 59 56 typedef struct { 60 57 link_t lreq; … … 187 184 struct sockaddr_in addr; 188 185 trans_req_t *treq; 189 int ntry;190 186 191 187 req_data = NULL; … … 200 196 goto error; 201 197 202 ntry = 0; 203 204 while (ntry < REQ_RETRY_MAX) { 205 rc = sendto(transport_fd, req_data, req_size, 0, 206 (struct sockaddr *)&addr, sizeof(addr)); 207 if (rc != EOK) 208 goto error; 209 210 treq = treq_create(req); 211 if (treq == NULL) { 212 rc = ENOMEM; 198 rc = sendto(transport_fd, req_data, req_size, 0, 199 (struct sockaddr *)&addr, sizeof(addr)); 200 if (rc != EOK) 201 goto error; 202 203 treq = treq_create(req); 204 if (treq == NULL) { 205 rc = ENOMEM; 206 goto error; 207 } 208 209 fibril_mutex_lock(&treq->done_lock); 210 while (treq->done != true) { 211 rc = fibril_condvar_wait_timeout(&treq->done_cv, &treq->done_lock, 212 REQ_TIMEOUT); 213 if (rc == ETIMEOUT) { 214 fibril_mutex_unlock(&treq->done_lock); 215 rc = EIO; 213 216 goto error; 214 217 } 215 216 217 fibril_mutex_lock(&treq->done_lock); 218 while (treq->done != true) { 219 rc = fibril_condvar_wait_timeout(&treq->done_cv, &treq->done_lock, 220 REQ_TIMEOUT); 221 if (rc == ETIMEOUT) { 222 ++ntry; 223 break; 224 } 225 } 226 227 fibril_mutex_unlock(&treq->done_lock); 228 229 if (rc != ETIMEOUT) 230 break; 231 } 232 233 if (ntry >= REQ_RETRY_MAX) { 234 rc = EIO; 235 goto error; 236 } 218 } 219 220 fibril_mutex_unlock(&treq->done_lock); 237 221 238 222 if (treq->status != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.