[Goodies-dev] [Bug 2934] New: Weather Search Not Working

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Wed Feb 21 21:21:36 CET 2007


DO NOT REPLY TO THIS EMAIL.  Also, do not reply via email to the person
whose email is mentioned below.  To comment on this bug, please visit:
http://bugzilla.xfce.org/show_bug.cgi?id=2934

           Summary: Weather Search Not Working
           Product: Xfce Panel Plugins
           Version: unspecified
          Platform: PC (x86)
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: Medium
         Component: weather
        AssignedTo: goodies-dev at xfce.org
        ReportedBy: shild at sbcglobal.net


The search is not working.  The http socket is used before the connect is
finished.  I added the below code to http_connect() in weather-http.c and it
fixes the problem.

  else {
      gint iters_left;

      for (iters_left = 25; iters_left >= 0; iters_left--) {

          fd_set wfd;
          struct timeval tv = { 2, 0 };
          int sock_err = 0;
          socklen_t sock_err_len = sizeof(int);
          gpointer msg;

          FD_ZERO(&wfd);
          FD_SET(fd, &wfd);

          DBG("checking for a connection...");

          /* wait until the connect attempt finishes */
          if(select(FD_SETSIZE, NULL, &wfd, NULL, &tv) < 0)
              break;

          /* check to see if it finished, and, if so, if there was an
           * error, or if it completed successfully */
          if(FD_ISSET(fd, &wfd)) {
              if (!getsockopt(fd, SOL_SOCKET, SO_ERROR, &sock_err,
&sock_err_len)
                  && !sock_err)
              {
                  DBG("    connection succeeded");
              } else {
                  DBG("    connection failed: sock_err is %d", sock_err);
              }
              break;
          }

      }

      return fd;

I am not sure that this is the proper place for the code, but it does fix the
problem.


-- 
Configure bugmail: http://bugzilla.xfce.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Goodies-dev mailing list