Changeset f4a27304 in mainline
- Timestamp:
- 2013-07-16T16:26:51Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c0f3460
- Parents:
- a940f1d
- Location:
- uspace/srv/net
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/sock.c
ra940f1d rf4a27304 613 613 ipc_callid_t wcallid; 614 614 size_t length; 615 uint8_t buffer[TCP_SOCK_FRAGMENT_SIZE];616 615 tcp_error_t trc; 617 616 int rc; 617 618 uint8_t *buffer = calloc(TCP_SOCK_FRAGMENT_SIZE, 1); 619 if (buffer == NULL) { 620 async_answer_0(callid, ENOMEM); 621 return; 622 } 618 623 619 624 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_sock_send()"); … … 625 630 if (sock_core == NULL) { 626 631 async_answer_0(callid, ENOTSOCK); 627 return;632 goto out; 628 633 } 629 634 … … 641 646 fibril_mutex_unlock(&socket->lock); 642 647 async_answer_0(callid, EINVAL); 643 return;648 goto out; 644 649 } 645 650 … … 651 656 fibril_mutex_unlock(&socket->lock); 652 657 async_answer_0(callid, rc); 653 return;658 goto out; 654 659 } 655 660 … … 676 681 fibril_mutex_unlock(&socket->lock); 677 682 async_answer_0(callid, rc); 678 return;683 goto out; 679 684 } 680 685 } … … 685 690 IPC_GET_ARG2(answer)); 686 691 fibril_mutex_unlock(&socket->lock); 692 693 out: 694 free(buffer); 687 695 } 688 696 -
uspace/srv/net/udp/sock.c
ra940f1d rf4a27304 265 265 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_send()"); 266 266 267 uint8_t *buffer = calloc(UDP_FRAGMENT_SIZE, 1); 268 if (buffer == NULL) { 269 async_answer_0(callid, ENOMEM); 270 return; 271 } 272 267 273 struct sockaddr_in6 *addr6 = NULL; 268 274 struct sockaddr_in *addr; … … 276 282 if (rc != EOK) { 277 283 async_answer_0(callid, rc); 278 return;284 goto out; 279 285 } 280 286 … … 357 363 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_sendto: Failed to " 358 364 "determine local address."); 359 return;365 goto out; 360 366 } 361 367 … … 379 385 length = UDP_FRAGMENT_SIZE; 380 386 381 uint8_t buffer[UDP_FRAGMENT_SIZE];382 387 int rc = async_data_write_finalize(wcallid, buffer, length); 383 388 if (rc != EOK) { … … 425 430 if (addr6 != NULL) 426 431 free(addr6); 432 433 free(buffer); 427 434 } 428 435
Note:
See TracChangeset
for help on using the changeset viewer.