/[winpt]/trunk/Src/wptHTTP.cpp
ViewVC logotype

Diff of /trunk/Src/wptHTTP.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 350 by twoaday, Fri Sep 25 16:07:38 2009 UTC revision 351 by twoaday, Thu Dec 1 20:10:25 2011 UTC
# Line 198  NetHTTP::findHeader (http_head_t root, Line 198  NetHTTP::findHeader (http_head_t root,
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;
# Line 267  NetHTTP::connect (const char *_host, int Line 266  NetHTTP::connect (const char *_host, int
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;
# Line 288  NetHTTP::isDataAvailable (int _fd) Line 286  NetHTTP::isDataAvailable (int _fd)
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;

Legend:
Removed from v.350  
changed lines
  Added in v.351

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26