server: proxy: show indicative log on bind failure.

This commit is contained in:
Kobi Mizrachi 2020-01-27 08:23:28 +02:00 committed by akallabeth
parent e4a2287f4d
commit 8c8e5e4239
3 changed files with 14 additions and 4 deletions

View File

@ -1542,5 +1542,4 @@ BOOL rdp_send_server_status_info(rdpContext* context, UINT32 status)
Stream_Write_UINT32(s, status);
return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_STATUS_INFO, rdp->mcs->userId);
;
}

View File

@ -28,7 +28,6 @@
#include <winpr/collections.h>
#include <stdlib.h>
#include <signal.h>
#include <winpr/cmdline.h>
#define TAG PROXY_TAG("server")

View File

@ -25,6 +25,7 @@
#include <winpr/string.h>
#include <winpr/winsock.h>
#include <winpr/thread.h>
#include <errno.h>
#include <freerdp/freerdp.h>
#include <freerdp/channels/wtsvc.h>
@ -453,8 +454,19 @@ BOOL pf_server_start(proxyServer* server)
if (!server->listener->Open(server->listener, server->config->Host, server->config->Port))
{
WLog_ERR(TAG,
"listener->Open failed! Port might be already used, or insufficient permissions.");
switch (errno)
{
case EADDRINUSE:
WLog_ERR(TAG, "failed to start listener: address already in use!");
break;
case EACCES:
WLog_ERR(TAG, "failed to start listener: insufficent permissions!");
break;
default:
WLog_ERR(TAG, "failed to start listener: errno=%d", errno);
break;
}
goto error;
}