Commit 7d39b280 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

[MDEV-9468]: Client hangs in my_addr_resolve

Account for timeout of select returning a 0 error code.
parent d2273993
...@@ -175,6 +175,10 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc) ...@@ -175,6 +175,10 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc)
sizeof(output) - total_bytes_read); sizeof(output) - total_bytes_read);
if (extra_bytes_read < 0) if (extra_bytes_read < 0)
return 1; return 1;
/* Timeout or max bytes read. */
if (extra_bytes_read == 0)
break;
total_bytes_read += extra_bytes_read; total_bytes_read += extra_bytes_read;
} }
...@@ -183,7 +187,7 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc) ...@@ -183,7 +187,7 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc)
return 1; return 1;
/* Go through the addr2line response and get the required data. /* Go through the addr2line response and get the required data.
The response is structured in 2 lnes. The first line contains the function The response is structured in 2 lines. The first line contains the function
name, while the second one contains <filename>:<line number> */ name, while the second one contains <filename>:<line number> */
for (i = 0; i < total_bytes_read; i++) { for (i = 0; i < total_bytes_read; i++) {
if (output[i] == '\n') { if (output[i] == '\n') {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment