Skip to content
Snippets Groups Projects
Commit 056b735a authored by Deon George's avatar Deon George
Browse files

Increase hapstr to 128, and define macros for haproxy binary connections.

Updates for sbbs/sbbs!11
parent 8ee80da6
No related branches found
No related tags found
No related merge requests found
/* haproxy.h */
/* HAPROXY PROTOCOL constant definitions */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
/* HAPROXY PROTO BINARY DEFINITIONS */
#define HAPROXY_AFINET 0x1 /* IPv4 Connection */
#define HAPROXY_AFINET6 0x2 /* IPv6 Connection */
......@@ -42,6 +42,7 @@
#include "js_rtpool.h"
#include "js_request.h"
#include "ssl.h"
#include "haproxy.h"
#include <multisock.h>
#include <limits.h> // HOST_NAME_MAX
......@@ -4986,7 +4987,7 @@ static void cleanup(int code)
void DLLCALL bbs_thread(void* arg)
{
struct addrinfo *res;
unsigned char hapstr[108];
unsigned char hapstr[128];
char host_name[256];
char* identity;
......@@ -5626,7 +5627,7 @@ NO_SSH:
switch (l) {
// IPv4 - AF_INET
case 0x1:
case HAPROXY_AFINET:
if (i < 4) {
lprintf(LOG_ERR,"%04d * HAPROXY Something went wrong - IPv4 address length too small [%s]",client_socket,hapstr);
close_socket(client_socket);
......@@ -5643,7 +5644,7 @@ NO_SSH:
break;
// IPv6 - AF_INET6
case 0x2:
case HAPROXY_AFINET6:
if (i < 16) {
lprintf(LOG_ERR,"%04d * HAPROXY Something went wrong - IPv6 address length too small [%s]",client_socket,hapstr);
close_socket(client_socket);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment