198 |
|
|
199 |
*val = NULL; |
*val = NULL; |
200 |
for (n = root; n; n = n->next) { |
for (n = root; n; n = n->next) { |
201 |
if (strlen (n->d) >= strlen (name) && |
if (strlen (n->d) >= strlen (name) && strstr (n->d, name)) { |
|
strstr (n->d, name)) { |
|
202 |
p = strchr (n->d, ':'); |
p = strchr (n->d, ':'); |
203 |
*val = p? n->d + (p - n->d + 1 + 1) : NULL; |
*val = p? n->d + (p - n->d + 1 + 1) : NULL; |
204 |
return true; |
return true; |
266 |
int |
int |
267 |
NetHTTP::isDataAvailable (int _fd) |
NetHTTP::isDataAvailable (int _fd) |
268 |
{ |
{ |
269 |
struct timeval tv; |
struct timeval tv; |
270 |
fd_set inp; |
fd_set inp; |
271 |
int n; |
|
|
|
|
272 |
FD_ZERO (&inp); |
FD_ZERO (&inp); |
273 |
FD_SET (_fd, &inp); |
FD_SET (_fd, &inp); |
274 |
tv.tv_sec = 1; |
tv.tv_sec = 1; |
275 |
tv.tv_usec = 0; |
tv.tv_usec = 0; |
276 |
|
|
277 |
n = select (_fd+1, &inp, NULL, NULL, &tv); |
int n = select (_fd+1, &inp, NULL, NULL, &tv); |
278 |
if (n && FD_ISSET (_fd, &inp)) |
if (n && FD_ISSET (_fd, &inp)) |
279 |
return n; |
return n; |
280 |
return 0; |
return 0; |
286 |
Return value: 0 on success. */ |
Return value: 0 on success. */ |
287 |
int |
int |
288 |
NetHTTP::readLine (char *buf, unsigned int nbuf, |
NetHTTP::readLine (char *buf, unsigned int nbuf, |
289 |
int nonblock, int *nn, int *eof) |
int nonblock, int *nn, int *eof) |
290 |
{ |
{ |
291 |
char c; |
char c; |
292 |
int n, i; |
int n, i; |