mirror of
https://github.com/lammertb/libhttp.git
synced 2025-09-03 01:21:16 +03:00
Autoformat after merge
This commit is contained in:
@@ -1453,13 +1453,23 @@ static void sockaddr_to_string(char *buf, size_t len, const union usa *usa)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (usa->sa.sa_family == AF_INET) {
|
if (usa->sa.sa_family == AF_INET) {
|
||||||
getnameinfo(
|
getnameinfo(&usa->sa,
|
||||||
&usa->sa, sizeof(usa->sin), buf, (unsigned)len, NULL, 0, NI_NUMERICHOST);
|
sizeof(usa->sin),
|
||||||
|
buf,
|
||||||
|
(unsigned)len,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
NI_NUMERICHOST);
|
||||||
}
|
}
|
||||||
#if defined(USE_IPV6)
|
#if defined(USE_IPV6)
|
||||||
else if (usa->sa.sa_family == AF_INET6) {
|
else if (usa->sa.sa_family == AF_INET6) {
|
||||||
getnameinfo(
|
getnameinfo(&usa->sa,
|
||||||
&usa->sa, sizeof(usa->sin6), buf, (unsigned)len, NULL, 0, NI_NUMERICHOST);
|
sizeof(usa->sin6),
|
||||||
|
buf,
|
||||||
|
(unsigned)len,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
NI_NUMERICHOST);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2484,7 +2494,7 @@ static int poll(struct pollfd *pfd, unsigned int n, int milliseconds)
|
|||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
fd_set set;
|
fd_set set;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int result;
|
int result;
|
||||||
SOCKET maxfd = 0;
|
SOCKET maxfd = 0;
|
||||||
|
|
||||||
tv.tv_sec = milliseconds / 1000;
|
tv.tv_sec = milliseconds / 1000;
|
||||||
@@ -4583,7 +4593,7 @@ static SOCKET conn2(struct mg_context *ctx /* may be null */,
|
|||||||
memset(&sain, '\0', sizeof(sain));
|
memset(&sain, '\0', sizeof(sain));
|
||||||
sain.sin_family = AF_INET;
|
sain.sin_family = AF_INET;
|
||||||
sain.sin_port = htons((uint16_t)port);
|
sain.sin_port = htons((uint16_t)port);
|
||||||
sain.sin_addr = *(struct in_addr *)(void*)he->h_addr_list[0];
|
sain.sin_addr = *(struct in_addr *)(void *)he->h_addr_list[0];
|
||||||
if (connect(sock, (struct sockaddr *)&sain, sizeof(sain)) != 0) {
|
if (connect(sock, (struct sockaddr *)&sain, sizeof(sain)) != 0) {
|
||||||
snprintf(ebuf,
|
snprintf(ebuf,
|
||||||
ebuf_len,
|
ebuf_len,
|
||||||
|
10
src/main.c
10
src/main.c
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#if defined(__cplusplus) && (__cplusplus >= 201103L)
|
#if defined(__cplusplus) && (__cplusplus >= 201103L)
|
||||||
#define NO_RETURN [[noreturn]]
|
#define NO_RETURN [[noreturn]]
|
||||||
#elif defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
|
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
|
||||||
#define NO_RETURN _Noreturn
|
#define NO_RETURN _Noreturn
|
||||||
#else
|
#else
|
||||||
#define NO_RETURN
|
#define NO_RETURN
|
||||||
@@ -1079,7 +1079,8 @@ struct tstring_input_buf {
|
|||||||
char *buffer;
|
char *buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
static INT_PTR CALLBACK InputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP)
|
static INT_PTR CALLBACK
|
||||||
|
InputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP)
|
||||||
{
|
{
|
||||||
static struct tstring_input_buf *inBuf = 0;
|
static struct tstring_input_buf *inBuf = 0;
|
||||||
WORD ctrlId;
|
WORD ctrlId;
|
||||||
@@ -1094,8 +1095,9 @@ static INT_PTR CALLBACK InputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
|
|||||||
ctrlId = LOWORD(wParam);
|
ctrlId = LOWORD(wParam);
|
||||||
if (ctrlId == IDOK) {
|
if (ctrlId == IDOK) {
|
||||||
/* Add user */
|
/* Add user */
|
||||||
GetWindowText(
|
GetWindowText(GetDlgItem(hDlg, ID_INPUT_LINE),
|
||||||
GetDlgItem(hDlg, ID_INPUT_LINE), inBuf->buffer, (int)inBuf->buflen);
|
inBuf->buffer,
|
||||||
|
(int)inBuf->buflen);
|
||||||
if (strlen(inBuf->buffer) > 0) {
|
if (strlen(inBuf->buffer) > 0) {
|
||||||
EndDialog(hDlg, IDOK);
|
EndDialog(hDlg, IDOK);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user