* upsie. that conversion to strbuf was still hanging around, heres the rest of it.
authorWilfried Göesgens <willi@citadel.org>
Thu, 17 Jun 2010 20:03:15 +0000 (20:03 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 17 Jun 2010 20:03:15 +0000 (20:03 +0000)
webcit/downloads.c
webcit/paramhandling.c
webcit/webcit.h

index 84409acd78e7a10110b827dc4542a06311d350e8..8d4eb33b6e1d6a4c63ae7e63f12f3a8581414694 100644 (file)
@@ -322,10 +322,18 @@ void upload_file(void)
        char buf[1024];
        long bytes_transmitted = 0;
        long blocksize;
+       const StrBuf *Desc;
        wcsession *WCC = WC;     /* stack this for faster access (WC is a function) */
 
        MimeType = GuessMimeType(ChrPtr(WCC->upload), WCC->upload_length); 
-       serv_printf("UOPN %s|%s|%s", WCC->upload_filename, MimeType, bstr("description"));
+
+               Desc = sbstr("description");
+
+       serv_printf("UOPN %s|%s|%s", 
+                   ChrPtr(WCC->upload_filename), 
+                   MimeType, 
+                   ChrPtr(Desc));
+
        serv_getln(buf, sizeof buf);
        if (buf[0] != '2')
        {
index 912fdc5febe61328aaebee8cf66647f0b13f2ddf..e257e4517e61aecc38fc7efe21d6a45dae93cc8a 100644 (file)
@@ -320,8 +320,7 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp,
        if ( (length > 0) && (!IsEmptyStr(cbtype)) ) {
                WCC->upload = NewStrBufPlain(content, length);
                WCC->upload_length = length;
-               safestrncpy(WCC->upload_filename, filename,
-                           sizeof(WC->upload_filename));
+               WCC->upload_filename = NewStrBufPlain(filename, -1);
                safestrncpy(WCC->upload_content_type, cbtype,
                            sizeof(WC->upload_content_type));
                
@@ -441,4 +440,5 @@ SessionDetachModule_PARAMHANDLING
 (wcsession *sess)
 {
        DeleteHash(&sess->Hdr->urlstrings);
+       FreeStrBuf(&sess->upload_filename);
 }
index 2e53e309802580f1084a878059c763b278cd0f5b..8fab4872190e3e14af7c21175447c86cab3d30be 100644 (file)
@@ -396,7 +396,7 @@ enum {
        eCOPY,
        eNONE
 };
-const char *ReqStrs[eNONE];
+extern const char *ReqStrs[eNONE];
 
 #define NO_AUTH 0
 #define AUTH_COOKIE 1
@@ -508,7 +508,6 @@ struct wcsession {
 
 /* Preferences */
        StrBuf *cs_inet_email;                  /* User's preferred Internet addr. */
-       char reply_to[512];                     /* reply-to address */
        HashList *hash_prefs;                   /* WebCit preferences for this user */
        StrBuf *DefaultCharset;                 /* Charset the user preferes */
        int downloaded_prefs;                   /* Has the client download its prefs yet? */
@@ -516,16 +515,6 @@ struct wcsession {
        int selected_language;                  /* Language selected by user */
        int time_format_cache;                  /* which timeformat does our user like? */
 
-/* current room related */
-/*     StrBuf *wc_roomname;                    / * Room we are currently in */
-/*     unsigned room_flags;                    / * flags associated with the current room */
-/*     unsigned room_flags2;                   / * flags associated with the current room */
-/*     int wc_view;                            / * view for the current room */
-/*     int wc_default_view;                    / * default view for the current room */
-/*     int wc_is_trash;                        / * nonzero == current room is a Trash folder */
-/*     int wc_floor;                           / * floor number of current room */
-/*     int is_mailbox;                         / * the current room is a private mailbox */
-
        folder CurRoom;                         /* information about our current room */
        const folder *ThisRoom;                 /* if REST found a room, remember it here. */
 /* next/previous room thingabob */
@@ -537,7 +526,7 @@ struct wcsession {
        HashList *attachments;                  /* list of attachments for 'enter message' */
        int upload_length;                      /* content length of http-uploaded data */
        StrBuf *upload;                         /* pointer to http-uploaded data */
-       char upload_filename[PATH_MAX];         /* filename of http-uploaded data */
+       StrBuf *upload_filename;                /* filename of http-uploaded data */
        char upload_content_type[256];          /* content type of http-uploaded data */
 
        int new_mail;                           /* user has new mail waiting */