diff --git a/pd/nw/todo.txt b/pd/nw/todo.txt index 96dfb98b1c37127cd34a2959079367c3865b0d9a..0612ec4c300997a07986f3c0000155faa516856a 100644 --- a/pd/nw/todo.txt +++ b/pd/nw/todo.txt @@ -291,6 +291,21 @@ Everything else: (A [x] means we've fixed it) [ ] Figure out what pdtk_ping does [ ] Instead of hardcoded gui_post colors, set a class (warning, error, etc.) [x] make pdsend able to take an arbitrary number of arguments +[ ] revisit the function for escaping double-quotes inside s_inter.c, see + if there's a cleaner way to do it +[ ] the socket reader has a buffer capped at 4096. This is plenty for most + purposes, but it may choke if the user tries to enter a humongous amount + of text inside, say, a message box. Pd Vanilla handles this by sending + every single character that's typed into the box as a separate message + (which of course causes other problems, like copy/paste potentially flood- + ing the socket and freezing Pd.) Here, I am sending as a single message + "stringforobj" with the msg/obj box contents as the arguments. If that + message ends up being bigger than 4096 Pd will truncate the message. + + A solution would be to send the box contents in smaller chunks-- bigger + than single chars but smaller than 4096. This will complicate the + interface, but the chunks should get sent in sequence so it might not + be too bad. Crashers -------- diff --git a/pd/src/s_inter.c b/pd/src/s_inter.c index 0f355df030bb97c806f592d41d13eb6709f2a282..0bda5c887aa266eb896fbdb085f876cb625fdf40 100644 --- a/pd/src/s_inter.c +++ b/pd/src/s_inter.c @@ -753,9 +753,9 @@ void sys_gui(const char *s) } char *escape_double_quotes(const char *src) { - static char ret[MAXPDSTRING*2+1]; + static char ret[MAXPDSTRING*4+1]; char *escaped = ret; - int i, len = MAXPDSTRING*2; + int i, len = MAXPDSTRING*4; for (i = 0; i < len-1 && src[i] != 0; i++) { if (src[i] == '\"') @@ -767,7 +767,7 @@ char *escape_double_quotes(const char *src) { "in a lazy attempt to escape double-quotes for the gui. " "Please call me out publicly for this regression, and/or revise this " "so it doesn't arbitrarily limit the size of the strings " - "we can send to the gui."); + "we can send to the gui.\n"); return ret; }