I didn’t tested it, strange it is not initially implemented to return value as default, there is no much practical use without value. Btw., regarding your function, are you sure this will work on large files and $thefile will not reach variable size limit or maybe device memory limit, since it appends to it bytes from all chunks? I think for parsing purposes bytes buffer variable will need to hold only bytes between delimiters (new line in this case) not all file bytes to avoid memory limits and adding parsed IP into address list should be performed inside chunk iteration when delimiter is reached.
Edit:
@Kataius idk. why I this didn’t come to my mind initially, since web server supports chunked download, but this is for ROS 7.14 only (read below why):
You can append to bytes buffer fetched chunk bytes and parse buffer by new line delimiter and also match to IP address as validation (you already have that in script) and add that IP into address list, then remove parsed bytes from buffer - this is to avoid buffer var. size limit when bytes are appended in another iteration (lines are not that long), this all needs to be performed inside fetch chunk loop. First you will need to perform HTTP HEAD method request on URL and read “content-length” header to get full size in bytes which you need to calculate number of chunks, but unfortunately HTTP HEAD method for fetch is available from ROS 7.14 so you will need to run that ROS version if you want to achieve this.
Tip: To properly handle possible fetch connection/server errors while populating address list in chunks loop, better use temporary list and when fetch performed successfully for all chunks then remove all items from actually used address list and items in temp address list put into actual address list. If something failed during chunked fetch just remove temp address list for cleanup and finish operation.