mirror of
https://github.com/lxsang/ant-http
synced 2024-12-26 16:58:22 +01:00
fix setsockopt
This commit is contained in:
parent
02d48fb659
commit
7e0232f299
BIN
dist/antd-1.0.6b.tar.gz
vendored
BIN
dist/antd-1.0.6b.tar.gz
vendored
Binary file not shown.
@ -673,7 +673,6 @@ int startup(unsigned *port)
|
|||||||
{
|
{
|
||||||
int httpd = 0;
|
int httpd = 0;
|
||||||
struct sockaddr_in name;
|
struct sockaddr_in name;
|
||||||
uint8_t on = 1;
|
|
||||||
httpd = socket(PF_INET, SOCK_STREAM, 0);
|
httpd = socket(PF_INET, SOCK_STREAM, 0);
|
||||||
if (httpd == -1)
|
if (httpd == -1)
|
||||||
{
|
{
|
||||||
@ -681,7 +680,7 @@ int startup(unsigned *port)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setsockopt(httpd, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)) == -1)
|
if (setsockopt(httpd, SOL_SOCKET, SO_REUSEADDR, &(int){1}, sizeof(int)) == -1)
|
||||||
{
|
{
|
||||||
ERROR("Unable to set reuse address on port %d - setsockopt: %s", *port, strerror(errno));
|
ERROR("Unable to set reuse address on port %d - setsockopt: %s", *port, strerror(errno));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user