Skip to content

Commit 0ad0cc0

Browse files
committed
Merge branch '3.3' into 3.4
2 parents b790c6c + c71865e commit 0ad0cc0

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

include/mariadb_com.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ void ma_net_end(NET *net);
419419
void ma_net_clear(NET *net);
420420
int ma_net_flush(NET *net);
421421
int ma_net_write(NET *net,const unsigned char *packet, size_t len);
422+
int ma_net_write_buff(NET *net, const char *packet, size_t len);
422423
int ma_net_write_command(NET *net,unsigned char command,const char *packet,
423424
size_t len, my_bool disable_flush);
424425
int ma_net_real_write(NET *net,const char *packet, size_t len);

libmariadb/ma_net.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ ulong net_buffer_length= 8192; /* Default length. Enlarged if necessary */
7878
** can't normally do this the client should have a bigger max-buffer.
7979
*/
8080

81-
static int ma_net_write_buff(NET *net,const char *packet, size_t len);
81+
int ma_net_write_buff(NET *net,const char *packet, size_t len);
8282

8383

8484
/* Init with packet info */
@@ -251,7 +251,7 @@ int ma_net_write_command(NET *net, uchar command,
251251
}
252252

253253

254-
static int ma_net_write_buff(NET *net,const char *packet, size_t len)
254+
int ma_net_write_buff(NET *net,const char *packet, size_t len)
255255
{
256256
size_t left_length;
257257

libmariadb/mariadb_lib.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,17 +1798,6 @@ MYSQL *mthd_my_real_connect(MYSQL *mysql, const char *host, const char *user,
17981798
goto error;
17991799
}
18001800

1801-
if (mysql->options.extension && mysql->options.extension->proxy_header)
1802-
{
1803-
char *hdr = mysql->options.extension->proxy_header;
1804-
size_t len = mysql->options.extension->proxy_header_len;
1805-
if (ma_pvio_write(pvio, (unsigned char *)hdr, len) <= 0)
1806-
{
1807-
ma_pvio_close(pvio);
1808-
goto error;
1809-
}
1810-
}
1811-
18121801
if (ma_net_init(net, pvio))
18131802
{
18141803
ma_pvio_close(pvio);

plugins/auth/my_auth.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
277277
char *buff, *end;
278278
size_t conn_attr_len= (mysql->options.extension) ?
279279
mysql->options.extension->connect_attrs_len : 0;
280+
size_t proxy_header_len= 0;
281+
char *proxy_header=
282+
(mysql->options.extension) ? mysql->options.extension->proxy_header : NULL;
283+
if (proxy_header)
284+
proxy_header_len= mysql->options.extension->proxy_header_len;
280285

281286
/* see end= buff+32 below, fixed size of the packet is 32 bytes */
282287
buff= malloc(33 + USERNAME_LENGTH + data_len + NAME_LEN + NAME_LEN + conn_attr_len + 9);
@@ -414,6 +419,9 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
414419
Send mysql->client_flag, max_packet_size - unencrypted otherwise
415420
the server does not know we want to do SSL
416421
*/
422+
if (proxy_header_len)
423+
ma_net_write_buff(net, proxy_header, proxy_header_len);
424+
417425
if (ma_net_write(net, (unsigned char *)buff, (size_t) (end-buff)) || ma_net_flush(net))
418426
{
419427
my_set_error(mysql, CR_SERVER_LOST, SQLSTATE_UNKNOWN,
@@ -524,6 +532,8 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
524532
*end++= compression_level;
525533
}
526534

535+
if (proxy_header_len)
536+
ma_net_write_buff(net, proxy_header, proxy_header_len);
527537
/* Write authentication package */
528538
if (ma_net_write(net, (unsigned char *)buff, (size_t) (end-buff)) || ma_net_flush(net))
529539
{

0 commit comments

Comments
 (0)