| 1191 | } |
| 1192 | |
| 1193 | TSReturnCode |
| 1194 | TSUrlPortSet(TSMBuffer bufp, TSMLoc obj, int port) |
| 1195 | { |
| 1196 | sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS); |
| 1197 | sdk_assert(sdk_sanity_check_url_handle(obj) == TS_SUCCESS); |
| 1198 | |
| 1199 | if (!isWriteable(bufp) || (port < 0)) { |
| 1200 | return TS_ERROR; |
| 1201 | } |
| 1202 | |
| 1203 | URL u; |
| 1204 | |
| 1205 | u.m_heap = (reinterpret_cast<HdrHeapSDKHandle *>(bufp))->m_heap; |
| 1206 | u.m_url_impl = reinterpret_cast<URLImpl *>(obj); |
| 1207 | u.port_set(port); |
| 1208 | return TS_SUCCESS; |
| 1209 | } |
| 1210 | |
| 1211 | /* FTP and HTTP specific URLs */ |
| 1212 | |