! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Weather Search Not Working
Status:
RESOLVED: FIXED
Product:
Xfce4-weather-plugin
Component:
General

Comments

Description Scott Hildreth 2007-02-21 20:21:35 CET
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.
Comment 1 Landry Breuil editbugs 2007-02-22 09:14:47 CET
I had the same issue, it works for me here now with this patch (OpenBSD -current)
Comment 2 Nick Schermer editbugs 2007-05-26 19:29:47 CEST
committed in trunk, we'll see if it works ;). Please reopen of it doesn't.
Comment 3 Jannis Pohlmann editbugs 2009-06-12 13:21:40 CEST
Re-assigning to Colin Leroy who is the new maintainer of the plugin.

Bug #2934

Reported by:
Scott Hildreth
Reported on: 2007-02-21
Last modified on: 2014-12-07

People

Assignee:
Colin Leroy
CC List:
1 user

Version

Version:
0.7.3 or older

Attachments

Additional information