_timeoutfgets optimization