Skip to content
Snippets Groups Projects
  1. Apr 01, 2019
  2. Mar 31, 2019
  3. Mar 26, 2019
  4. Mar 24, 2019
    • rswindell's avatar
      New JS bbs methods: · b4d31140
      rswindell authored
      - bbs.show_msg()
      - bbs.show_msg_header()
      Re-worked the JS bbs.netmail() implementation
      sbbs::show_msg(), show_msghdr(), msgtotxt() now take an smb_t* argument
      (don't use the pseudo-global 'smb' in these functions any longer)
      sbbs_t::putmsg() and JS console.putmsg() now accept an optional orig_columns
      argument to specify the original column width of a text for intelligent
      re-word-wrapping (e.g. as taken from a message header field). Previously, the
      original-column value was hard-coded to 80 columns (technically, 79).
      sbbs_t::show_msghdr() no longer sends a CRLF if the cursor is already at the
      top-of-screen (TOS).
      sbbs_t::show_msg() now uses the stored "columns" msg header fields to pass to
      putmsg() to intelligently re-word-wrap message bodies for display.
      sbbs_t::show_msg() and msgtotxt() return bool now instead of void.
      JS MsgBase.get_all_msg_headers() now supports an optional "expand_fields"
      argument (defaults to true). I contemplated just getting rid of the (few)
      expanding header fields (more like default-value-header fields, like 'id'), but
      decided against it, at least for now.
      JS MsgBase.put_msg_header(), the "number_or_offset" argument is optional and
      not needed if a header object argument is provided. Make this clear in this JS
      docs for this method
      
      Note:
      I sat on this commit for a while because I noticed occasional errors like this:
          Node 1 <Digital Man> !ERROR 2 (No such file or directory) (WinError 0) in
          readmsgs.cpp line 217 (sbbs_t::loadposts) locking
          "path/to/sub" access=-100 info=smb_locksmbhdr msgbase not open
      started cropping up after introducing these changes and which I never
      root-caused. But after a clean-build and waiting a week, I haven't seen it
      again, so hopefully it was just a incomplete rebuild issue and not a new bug.
      b4d31140
    • rswindell's avatar
    • rswindell's avatar
      Updated JS doc strings. · 079f2e69
      rswindell authored
      079f2e69
    • rswindell's avatar
      Support netmail addresses (e.g. Internet e-mail addresses) longer than the 35 · cd447d36
      rswindell authored
      character limit imposed by FidoNet message "to" fields, in sbbs_t::netmail().
      Use the regarding-message from_net field when a 'to' field is not passed to
      sbbs_t::netmail()
      cd447d36
    • rswindell's avatar
      Rename the 2 outbound interface keys that were introduced by Deuce in the big · cd883edd
      rswindell authored
      IPv6 commit of 2015:
      "OutgoingV4" is now "OutboundInterface" and
      "OutgoingV6" is now "OutboundV6Interface" (which is not yet used)
      cd883edd
  5. Mar 22, 2019
    • rswindell's avatar
      Use default calling convention (__cdecl) for DLL funcs in Borland builds. · bf82a889
      rswindell authored
      Fix age-old bug with Borland/C++Builder built executables (Windows):
      to achieve compatibility with  the default __cdecl symbol naming rules of
      Visual C++, we were using __stdcall convention for DLL functions when
      building code with Borland/C++Builder tools and using the default (__cdecl)
      convention when building with Microsoft (Visual C++) tools. Although this
      allowed symbols to be located when linking, the calling convention mismatch
      caused a stack cleanup issue that very rarely manifested itself in a bug
      (e.g. exception of some kind in sbbsctrl.exe, usually). Mismatching
      the calling conventions was unintentional (I thought the default for MSVC
      DLL functions was __stdcall) - but since the calls to MSVC-Built DLL functions
      worked 99% of the time, I didn't realize there was an underlying issue. So I
      now work-around the DLL symbol naming mismatch using a command-line option (-a)
      passed to implib in src/sbbs3/ctrl/makelibs.bat
      
      I had previously worked-around exceptions when calling MSVC DLL functions in
      sbbsctrl.exe by calling the problematic DLL functions from a timer tick handler
      rather than a user control (e.g. button) event handler. Those work-arounds can
      now be removed.
      
      The erroneous "DLLCALL" definition design pattern was replicated (copy/pasted)
      to many other projects' header files in cvs.synchro.net. In the future, we may
      want to just remove all instances of *CALL since they now serve no purpose and
      appear as useless "Kruft" (but do allow us to more-easily globally change DLL
      function calling conventions if/when necessary in the future).
      bf82a889
  6. Mar 19, 2019
  7. Mar 16, 2019
    • rswindell's avatar
      When adding a listfile (e.g. files.bbs), be a bit more strict: · e27d4a8f
      rswindell authored
      - filenames must begin with an alpha-numeric char. Might want to relax this in
        the future if it's a problem, but generally filenames on BBSes do begin with
        alpha-numeric characters and this will help us to identify an ignore
        "garbage" filenames in listfiles.
      - always check if the file actually exists, even when parsing the length of
        the file from the listfile. This will also help us to ignore garbage
        filenames.
      - also removed an inexplicable unpadfname() call. Filenames in file lists
        should *not* normally be padded (like "this    .txt") - so I'm not sure why
        this was in there. Perhaps for lists generated from filelist.exe (?). Anyway,
        out of an abundance of caution, removed it. Padded filenames are going away.
      e27d4a8f
    • rswindell's avatar
      MsgBase.get_all_msg_headers() is now more tolerant of corrupted msg bases, · 6f4324d9
      rswindell authored
      or more specifically, if the index (.sid) file is of an unexpected size
      (too big or too small) handle that situation gracefully.
      6f4324d9
  8. Mar 15, 2019
    • rswindell's avatar
      Fix (or work-around?) ScalingFactor issue reported by ogg in fsxNet->FSX BBS: · dca11a6f
      rswindell authored
      The ScalingFactor would always (or usually) reset to 1 and have to be reset
      e.g. to 2, by resizing the window manually, every time SyncTERM was run.
      
      I found that by calling textmode() *after* setscaling() rather than before
      fixed this issue (at least in SDL mode on Ubuntu Linux). Another "fix" that
      worked inserting a small (100ms) delay between the calls to textmode() and
      setscaling() - so there appears to have been a race condition and calling
      setccaling() too soon after text mode() would fail to change the window
      size successfully. Reordering these calls seems to work 100% of the time
      without any additional delays. <shrug> Deuce would likely know "why" better
      than I.
      dca11a6f
  9. Mar 13, 2019
    • rswindell's avatar
      Rewind the msgbase index file before calling fread(). The fread() would · 0032f847
      rswindell authored
      fail if the current file pointer (offset) was not currently at the beginning
      of the file. So calling MsgBase.get_all_msg_headers() after previously calling
      any method that read/seeked the index would cause the reported error:
      "index read (xxxx) failed"
      0032f847
    • rswindell's avatar
      More strict FidoNet address detection (e.g. so IPv6 addresses aren't · 7f1471af
      rswindell authored
      detected as net_type NET_FIDO).
      7f1471af
    • rswindell's avatar
      smb_netaddr_type() (exposed via JS as netaddr_type()) change: · d90ea2b8
      rswindell authored
      prior to rev 1.29 of this file (committed almost exactly one year ago), when
      called with any string that did not include an '@', would return NET_NONE (0).
      After rev 1.29, most strings that did not include an '@' would cause the
      function to return NET_QWK (4) - this was not intentional. The intention was
      that FidoNet addresses without an '@' would cause this function to return
      NET_FIDO (2) and I don't exactly remember why that change was made, but
      unfortunately, it wasn't made very well, so other invalid addresses would be
      detected as NET_QWK or NET_INTERNET or even NET_UNKNOWN.
      So before and after this commit:
      "" was NET_UNKNOWN, now NET_NONE
      "1" was NET_FIDO, now NET_FIDO
      "1x" was NET_INTERNET, now NET_NONE
      "1:103" was NET_FIDO, now NET_FIDO (this could use some work)
      "x" was NET_QWK, now NET_NONE
      d90ea2b8
    • rswindell's avatar
      When extracting FILE_ID.DIZ/DESC.SDI, search through the exractable file · 8bd7cbdd
      rswindell authored
      types twice - first to see if one matches the requirements. If none match,
      then search again just for an extractor matching the file extension.
      Modernize the get_file_diz() function a little bit (e.g. return bool).
      8bd7cbdd
    • rswindell's avatar
      Moved the copy/pasted FILE_ID.DIZ/DESC.SDI code (3 times!?!) into its own · 3bc8ba86
      rswindell authored
      function.
      Constify mycmdstr() arguments.
      Removed trailing whitespaces.
      No functional changes expected by this commit.
      3bc8ba86
  10. Mar 10, 2019
  11. Mar 08, 2019
  12. Mar 07, 2019
    • deuce's avatar
      There appears to be data corruption in cryptlib if a private key is added · 211a2a1a
      deuce authored
      to a second thread before the first has the session set active.  Add calls
      to lock/unlock the certificate to prevent this.
      
      The better options is likely to have a function that adds the key and socket
      and sets the session active in one call and handles the locking internally.
      
      But I'm lazy, so we get the lock functions.
      211a2a1a
  13. Feb 21, 2019
  14. Feb 20, 2019
    • rswindell's avatar
      Reversed course on the WM_QUOTE mode handling in sbbs_t::postmsg() · 57424543
      rswindell authored
      (JS bbs.post_msg()): If the WM_QUOTE mode flag is *not* set, then it will auto-
      create the quote file (quotes.txt) and add the WM_QUOTE mode bit before calling
      sbbs_t::writemsg(). So if existing JS scripts call bbs.post_msg(..., WM_QUOTE)
      with a custom-created quote file (e.g. with msg tails), that'll still work as
      before (e.g. DDMsgReader.js).
      
      bbs.email() and bbs.netmail() now support an optional reply_header_object
      argument which works like bbs.post_msg(). These methods (and the underlying
      C++ methods: sbbs_t::email(), netmail(), inetmail(), all auto-create the
      quote file now, when the WM_QUOTE mode flag is *not* set.
      
      The auto-created quotes.txt now includes the plain-text version of MIME-encoded
      messages.
      
      the bbs.post_msg(), email(), and netmail() methods now all support reply
      header objects that came directly from bbs.get_msg_header() *or* copies of
      such header objects (but the auto-quoting feature won't work when supplied
      this type of header object). So if passed a header object returned from
      bbs.get_msg_header(), we can now use the message base (for auto-quoting) and
      the underlying msg storage directly (no JS parsing necessary). This is what
      the new js_GetMsgHeaderObjectPrivates() function is used for.
      
      js_ParseMsgHeaderObject() (and the underlying parse_header_object() function)
      now supports either an actual internally-generated msg header object (e.g.
      returned from bbs.get_msg_header()) or one that is a copy or hand-constructed.
      
      quotemsg() no longer tries to get a copy of the msg index/header. It shouldn't
      have to since we can now get to underlying msg storage in the js_msgbase.c
      via js_GetMsgHeaderObjectPrivates().
      
      quotemsg() now reads only the plain-text portion of MIME-encoded messages.
      
      As part of this effort, I modernized the method prototypes using default
      argument values (e.g. WM_NONE for wm_mode arguments) and removed some
      extraneous WM_EMAIL and WM_NETMAIL specifications (these wm_mode flags are
      automatically added by the sbbs_t::email() and *netmail() functions).
      
      savemsg() now *does* support reply-IDs/thread-linkage via the additional
      'remsg' argument (when non-NULL).
      
      Replaced some use of nulstr with NULL.
      
      Replaced more boilerplate SMB open code with calls to smb_open_sub().
      57424543
  15. Feb 19, 2019
    • rswindell's avatar
      Fix long-standing bug in js_ParseMsgHeaderObject which is only (currently) · 121e87b7
      rswindell authored
      used by js_post_msg() (the JS bbs.post_msg() method when used with the
      reply_header object argument) - the private data attached to a message
      header object is of type privatemsg_t, not private_t. This caused the
      dereferences of and assignments to p->smb_result in parse_header_object()
      to corrupt the privatemsg_t->msg memory causing heap corruption (caught
      on Windows debug builds in js_get_msg_header_finalize()) and stack faults
      (caught on Linux-gcc in parse_recipient_object()). This one was hard to
      find. <whew!>
      121e87b7
    • rswindell's avatar
      Re-work the column-counting in outchar(). · 27c9842c
      rswindell authored
      I noticed that printable ctrl chars (e.g. 0x18 and 0x19) were not causing the
      current column position to increment, so that got me looking at this code and
      wondering why the LF/FF checking was outside the if(!outchar_esc) condition
      and being executed when CON_R_ECHO is off. So now, using a switch statement,
      it's cleaner and all the printable ctrl chars move the current column position
      correctly.
      27c9842c
    • rswindell's avatar
      sbbs_t::postmsg() and JS's bbs.post_msg() changes: · d95d30ea
      rswindell authored
      When the WM_QUOTE mode flag is set and the 'remsg' is specified, the original
      message will quoted (excluding message tails, using the proper word-wrapping).
      If the quote file already exists before calling postmsg()/bbs.post_msg(), it
      will be over-written. This allows JS script to initiate reply-posts with quoted
      text without having to create their own quotes file. It also means there's no
      need to call sbbs_t::quotemsg() before calling sbbs_t::postmsg().
      sbbs_t::quotemsg() now takes an smb_t* arg (stop using the sbbs_t 'global'
      smb) and now returns bool.
      d95d30ea
    • rswindell's avatar
      Fix bbs.post_msg() JSDOC description: mode defaults to WM_NONE, not WM_MODE. · 2c82a9dd
      rswindell authored
      Renamed js_postmsg() -> js_post_msg() for good measure.
      2c82a9dd
    • rswindell's avatar
      fee12237
  16. Feb 18, 2019
Loading