141 |
141 |
142 buf->pos += bytes_in_buffer; |
142 buf->pos += bytes_in_buffer; |
143 return bytes_in_buffer; |
143 return bytes_in_buffer; |
144 } |
144 } |
145 } |
145 } |
146 |
146 |
|
147 if(!buf->sd) { |
|
148 return NETBUF_EOF; |
|
149 } |
|
150 |
147 /* The netbuf is empty. Read data directly into the caller's buffer */ |
151 /* The netbuf is empty. Read data directly into the caller's buffer */ |
148 bytes = net_read(buf->sd, buffer, size); |
152 bytes = net_read(buf->sd, buffer, size); |
149 if (bytes == 0) |
153 if (bytes == 0) |
150 return NETBUF_EOF; |
154 return NETBUF_EOF; |
151 if (bytes < 0) { |
155 if (bytes < 0) { |