changeset 1439:79fcf67eeea0

Fixed bookmarks "cancel" link (Add/Mod URL, Add Sec). Also s/tmp_fd/sock_fd.
author Jorge Arellano Cid <jcid@dillo.org>
date Wed, 18 Nov 2009 10:29:43 -0300
parents 6e7568b823a7
children 4a8c159f5d9d
files dpi/bookmarks.c dpi/cookies.c dpi/file.c
diffstat 3 files changed, 18 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/dpi/bookmarks.c	Wed Nov 18 09:29:32 2009 -0300
+++ b/dpi/bookmarks.c	Wed Nov 18 10:29:43 2009 -0300
@@ -254,7 +254,7 @@
 "     Modify bookmarks :: add section\n"
 "    </td>\n"
 "    <td align='right'>\n"
-"     [<a href='dpi:/bm/modify'>cancel</a>]\n"
+"     [<a href='dpi:/bm/'>cancel</a>]\n"
 "    </td>\n"
 "   </tr>\n"
 "  </table></td></tr>\n"
@@ -299,7 +299,7 @@
 "   <tr><td bgcolor='#b4b4b4'> Modify bookmarks :: update\n"
 "    </td>\n"
 "    <td align='right'>\n"
-"     [<a href='dpi:/bm/modify'>cancel</a>]\n"
+"     [<a href='dpi:/bm/'>cancel</a>]\n"
 "    </td>\n"
 "   </tr>\n"
 "  </table></td></tr>\n"
@@ -367,7 +367,7 @@
 "   <tr><td bgcolor='#b4b4b4'> Modify bookmarks :: add url\n"
 "    </td>\n"
 "    <td align='right'>\n"
-"     [<a href='dpi:/bm/modify'>cancel</a>]\n"
+"     [<a href='dpi:/bm/'>cancel</a>]\n"
 "    </td>\n"
 "   </tr>\n"
 "  </table></td></tr>\n"
@@ -1688,7 +1688,7 @@
  */
 int main(void) {
    struct sockaddr_un spun;
-   int tmp_fd, code;
+   int sock_fd, code;
    socklen_t address_size;
    char *tok;
    Dsh *sh;
@@ -1717,14 +1717,14 @@
    MSG("(v.13): accepting connections...\n");
 
    while (1) {
-      tmp_fd = accept(STDIN_FILENO, (struct sockaddr *)&spun, &address_size);
-      if (tmp_fd == -1) {
+      sock_fd = accept(STDIN_FILENO, (struct sockaddr *)&spun, &address_size);
+      if (sock_fd == -1) {
          perror("[accept]");
          exit(1);
       }
 
       /* create the Dsh structure */
-      sh = a_Dpip_dsh_new(tmp_fd, tmp_fd, 8*1024);
+      sh = a_Dpip_dsh_new(sock_fd, sock_fd, 8*1024);
 
       /* Authenticate our client... */
       if (!(tok = a_Dpip_dsh_read_token(sh, 1)) ||
--- a/dpi/cookies.c	Wed Nov 18 09:29:32 2009 -0300
+++ b/dpi/cookies.c	Wed Nov 18 10:29:43 2009 -0300
@@ -1443,7 +1443,7 @@
    struct sockaddr_in sin;
    socklen_t address_size;
    ClientInfo *client;
-   int tmp_fd,code;
+   int sock_fd, code;
    char *buf;
    Dsh *sh;
 
@@ -1468,14 +1468,14 @@
    address_size = sizeof(struct sockaddr_in);
 
    while (1) {
-      tmp_fd = accept(STDIN_FILENO, (struct sockaddr *)&sin, &address_size);
-      if (tmp_fd == -1) {
+      sock_fd = accept(STDIN_FILENO, (struct sockaddr *)&sin, &address_size);
+      if (sock_fd == -1) {
          perror("[accept]");
          exit(1);
       }
 
       /* create the Dsh structure */
-      sh = a_Dpip_dsh_new(tmp_fd, tmp_fd, 8*1024);
+      sh = a_Dpip_dsh_new(sock_fd, sock_fd, 8*1024);
       client = dNew(ClientInfo,1);
       client->sh = sh;
       client->status = 0;
--- a/dpi/file.c	Wed Nov 18 09:29:32 2009 -0300
+++ b/dpi/file.c	Wed Nov 18 10:29:43 2009 -0300
@@ -1046,7 +1046,7 @@
 {
    struct sockaddr_in sin;
    socklen_t sin_sz;
-   int tmp_fd, c_st, st = 1;
+   int sock_fd, c_st, st = 1;
 
    /* Arrange the cleanup function for abnormal terminations */
    if (signal (SIGINT, termination_handler) == SIG_IGN)
@@ -1089,19 +1089,19 @@
       if (FD_ISSET(STDIN_FILENO, &read_set)) {
          /* accept the incoming connection */
          do {
-            tmp_fd = accept(STDIN_FILENO, (struct sockaddr *)&sin, &sin_sz);
-         } while (tmp_fd < 0 && errno == EINTR);
-         if (tmp_fd == -1) {
+            sock_fd = accept(STDIN_FILENO, (struct sockaddr *)&sin, &sin_sz);
+         } while (sock_fd < 0 && errno == EINTR);
+         if (sock_fd == -1) {
             if (errno == EAGAIN)
                continue;
             MSG(" accept() %s\n", dStrerror(errno));
             break;
          } else {
-            _MSG(" accept() fd=%d\n", tmp_fd);
+            _MSG(" accept() fd=%d\n", sock_fd);
             /* Set nonblocking */
-            fcntl(tmp_fd, F_SETFL, O_NONBLOCK | fcntl(tmp_fd, F_GETFL));
+            fcntl(sock_fd, F_SETFL, O_NONBLOCK | fcntl(sock_fd, F_GETFL));
             /* Create and initialize a new client */
-            File_add_client(tmp_fd);
+            File_add_client(sock_fd);
          }
          continue;
       }