Changeset a35b458 in mainline for uspace/lib/http/src/http.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/http/src/http.c
r3061bc1 ra35b458 60 60 if (http == NULL) 61 61 return NULL; 62 62 63 63 http->host = str_dup(host); 64 64 if (http->host == NULL) { … … 67 67 } 68 68 http->port = port; 69 69 70 70 http->buffer_size = 4096; 71 71 errno_t rc = recv_buffer_init(&http->recv_buffer, http->buffer_size, … … 75 75 return NULL; 76 76 } 77 77 78 78 return http; 79 79 } … … 83 83 if (http->conn != NULL) 84 84 return EBUSY; 85 85 86 86 errno_t rc = inet_host_plookup_one(http->host, ip_any, &http->addr, NULL, 87 87 NULL); 88 88 if (rc != EOK) 89 89 return rc; 90 90 91 91 inet_ep2_t epp; 92 92 93 93 inet_ep2_init(&epp); 94 94 epp.remote.addr = http->addr; 95 95 epp.remote.port = http->port; 96 96 97 97 rc = tcp_create(&http->tcp); 98 98 if (rc != EOK) 99 99 return rc; 100 100 101 101 rc = tcp_conn_create(http->tcp, &epp, NULL, NULL, &http->conn); 102 102 if (rc != EOK) 103 103 return rc; 104 104 105 105 rc = tcp_conn_wait_connected(http->conn); 106 106 if (rc != EOK) 107 107 return rc; 108 108 109 109 return rc; 110 110 } … … 114 114 if (http->conn == NULL) 115 115 return EINVAL; 116 116 117 117 tcp_conn_destroy(http->conn); 118 118 http->conn = NULL; 119 119 tcp_destroy(http->tcp); 120 120 http->tcp = NULL; 121 121 122 122 return EOK; 123 123 }
Note:
See TracChangeset
for help on using the changeset viewer.