1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-08-06 05:02:40 +03:00

Removed obsolete mg_get_ports

This commit is contained in:
Lammert Bies
2016-11-16 07:42:57 +01:00
parent 58cb982cb4
commit 5ca324c339
2 changed files with 4 additions and 35 deletions

View File

@@ -423,14 +423,7 @@ struct mg_server_ports {
The caller is responsibility to allocate the required memory.
This function returns the number of struct mg_server_ports elements
filled in, or <0 in case of an error. */
CIVETWEB_API int mg_get_server_ports(const struct mg_context *ctx,
int size,
struct mg_server_ports *ports);
/* Deprecated: Use mg_get_server_ports instead. */
CIVETWEB_API size_t
mg_get_ports(const struct mg_context *ctx, size_t size, int *ports, int *ssl);
CIVETWEB_API int mg_get_server_ports(const struct mg_context *ctx, int size, struct mg_server_ports *ports);
/* Add, edit or delete the entry in the passwords file.
@@ -445,15 +438,11 @@ mg_get_ports(const struct mg_context *ctx, size_t size, int *ports, int *ssl);
Return:
1 on success, 0 on error. */
CIVETWEB_API int mg_modify_passwords_file(const char *passwords_file_name,
const char *domain,
const char *user,
const char *password);
CIVETWEB_API int mg_modify_passwords_file(const char *passwords_file_name, const char *domain, const char *user, const char *password);
/* Return information associated with the request. */
CIVETWEB_API const struct mg_request_info *
mg_get_request_info(const struct mg_connection *);
CIVETWEB_API const struct mg_request_info *mg_get_request_info(const struct mg_connection *);
/* Send data to the client.

View File

@@ -1132,27 +1132,7 @@ void * mg_get_user_connection_data(const struct mg_connection *conn) {
}
size_t mg_get_ports(const struct mg_context *ctx, size_t size, int *ports, int *ssl) {
size_t i;
if (!ctx) { return 0; }
for (i = 0; i < size && i < ctx->num_listening_sockets; i++) {
ssl[i] = ctx->listening_sockets[i].is_ssl;
ports[i] =
#if defined(USE_IPV6)
(ctx->listening_sockets[i].lsa.sa.sa_family == AF_INET6)
? ntohs(ctx->listening_sockets[i].lsa.sin6.sin6_port)
:
#endif
ntohs(ctx->listening_sockets[i].lsa.sin.sin_port);
}
return i;
}
int
mg_get_server_ports(const struct mg_context *ctx, int size, struct mg_server_ports *ports) {
int mg_get_server_ports(const struct mg_context *ctx, int size, struct mg_server_ports *ports) {
int i, cnt = 0;